OpenSSL/quictls: add support for TLSv1.3 early data

based on #16450

Adds support for TLSv1.3 early data for TCP and QUIC via ngtcp2.

Closes #16477
This commit is contained in:
Stefan Eissing 2025-02-25 15:07:19 +01:00 committed by Daniel Stenberg
parent b5d99a5474
commit 0d3b5937b3
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
12 changed files with 308 additions and 69 deletions

View file

@ -577,9 +577,10 @@ class TestDownload:
@pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx")
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_02_32_earlydata(self, env: Env, httpd, nghttpx, proto):
if not env.curl_uses_lib('gnutls') and not env.curl_uses_lib('wolfssl'):
pytest.skip('TLS earlydata only implemented in GnuTLS/wolfSSL')
if proto == 'h3' and not env.have_h3():
if not env.curl_can_early_data():
pytest.skip('TLS earlydata not implemented')
if proto == 'h3' and \
(not env.have_h3() or not env.curl_can_h3_early_data()):
pytest.skip("h3 not supported")
count = 2
docname = 'data-10k'

View file

@ -703,9 +703,10 @@ class TestUpload:
# of 128K.
])
def test_07_70_put_earlydata(self, env: Env, httpd, nghttpx, proto, upload_size, exp_early):
if not env.curl_uses_lib('gnutls') and not env.curl_uses_lib('wolfssl'):
pytest.skip('TLS earlydata only implemented in GnuTLS/wolfSSL')
if proto == 'h3' and not env.have_h3():
if not env.curl_can_early_data():
pytest.skip('TLS earlydata not implemented')
if proto == 'h3' and \
(not env.have_h3() or not env.curl_can_h3_early_data()):
pytest.skip("h3 not supported")
count = 2
# we want this test to always connect to nghttpx, since it is

View file

@ -207,9 +207,10 @@ class TestCaddy:
@pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
def test_08_08_earlydata(self, env: Env, httpd, caddy, proto):
if not env.curl_uses_lib('gnutls') and not env.curl_uses_lib('wolfssl'):
pytest.skip('TLS earlydata only implemented in GnuTLS/wolfSSL')
if proto == 'h3' and not env.have_h3():
if not env.curl_can_early_data():
pytest.skip('TLS earlydata not implemented')
if proto == 'h3' and \
(not env.have_h3() or not env.curl_can_h3_early_data()):
pytest.skip("h3 not supported")
count = 2
docname = 'data10k.data'

View file

@ -252,8 +252,8 @@ class TestSSLUse:
if proto == 'h3' and not env.have_h3():
pytest.skip("h3 not supported")
if not env.curl_uses_lib('openssl') and \
not env.curl_uses_lib('gnutls') and \
not env.curl_uses_lib('quictls'):
not env.curl_uses_lib('gnutls') and \
not env.curl_uses_lib('quictls'):
pytest.skip("TLS library does not support --cert-status")
curl = CurlClient(env=env)
domain = 'localhost'
@ -318,8 +318,8 @@ class TestSSLUse:
if not env.have_h3():
pytest.skip("h3 not supported")
if not env.curl_uses_lib('quictls') and \
not env.curl_uses_lib('gnutls') and \
not env.curl_uses_lib('wolfssl'):
not env.curl_uses_lib('gnutls') and \
not env.curl_uses_lib('wolfssl'):
pytest.skip("QUIC session reuse not implemented")
count = 2
docname = 'data-10k'

View file

@ -382,6 +382,18 @@ class Env:
def curl_is_debug() -> bool:
return Env.CONFIG.curl_is_debug
@staticmethod
def curl_can_early_data() -> bool:
return Env.curl_uses_lib('gnutls') or \
Env.curl_uses_lib('wolfssl') or \
Env.curl_uses_lib('quictls') or \
Env.curl_uses_lib('openssl')
@staticmethod
def curl_can_h3_early_data() -> bool:
return Env.curl_can_early_data() and \
Env.curl_uses_lib('ngtcp2')
@staticmethod
def have_h3() -> bool:
return Env.have_h3_curl() and Env.have_h3_server()