curl/lib/vtls
Stefan Eissing 962097b8dd
TLS: TLSv1.3 earlydata support for curl
Based on #14135, implement TLSv1.3 earlydata support for the curl
command line, libcurl and its implementation in GnuTLS.

If a known TLS session announces early data support, and the feature is
enabled *and* it is not a "connect-only" transfer, delay the TLS
handshake until the first request is being sent.

- Add --tls-earldata as new boolean command line option for curl.
- Add CURLSSLOPT_EARLYDATA to libcurl to enable use of the feature.
- Add CURLINFO_EARLYDATA_SENT_T to libcurl, reporting the amount of
  bytes sent and accepted/rejected by the server.

Implementation details:
- store the ALPN protocol selected at the SSL session.
- When reusing the session and enabling earlydata, use exactly
  that ALPN protocol for negoptiation with the server. When the
  sessions ALPN does not match the connections ALPN, earlydata
  will not be enabled.
- Check that the server selected the correct ALPN protocol for
  an earlydata connect. If the server does not confirm or reports
  something different, the connect fails.
- HTTP/2: delay sending the initial SETTINGS frames during connect,
  if not connect-only.

Verification:
- add test_02_32 to verify earlydata GET with nghttpx.
- add test_07_70 to verify earlydata PUT with nghttpx.
- add support in 'hx-download', 'hx-upload' clients for the feature

Assisted-by: ad-chaos on github
Closes #15211
2024-10-11 12:28:22 +02:00
..
.checksrc lib: enable strerror and strncpy checksrc warnings in subdirs 2024-09-09 16:51:21 +02:00
bearssl.c TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
bearssl.h
cipher_suite.c lib: use bool/TRUE/FALSE properly 2024-10-03 09:31:56 +02:00
cipher_suite.h rustls: add support for setting TLS version and ciphers 2024-08-16 09:55:02 +02:00
gtls.c TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
gtls.h connection: shutdown TLS (for FTP) better 2024-06-10 13:08:12 +02:00
hostcheck.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostcheck.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
keylog.c lib: use bool/TRUE/FALSE properly 2024-10-03 09:31:56 +02:00
keylog.h
mbedtls_threadlock.c
mbedtls_threadlock.h
mbedtls.c TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
mbedtls.h
openssl.c TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
openssl.h openssl: certinfo errors now fail correctly 2024-09-04 23:41:44 +02:00
rustls.c TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
rustls.h
schannel_int.h tidy-up: rename CURL_WINDOWS_APP to CURL_WINDOWS_UWP 2024-09-19 19:24:12 +02:00
schannel_verify.c tidy-up: rename CURL_WINDOWS_APP to CURL_WINDOWS_UWP 2024-09-19 19:24:12 +02:00
schannel.c TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
schannel.h
sectransp.c TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
sectransp.h
vtls_int.h TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
vtls.c TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
vtls.h TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
wolfssl.c TLS: TLSv1.3 earlydata support for curl 2024-10-11 12:28:22 +02:00
wolfssl.h wolfssl: improve shutdown handling 2024-08-05 08:49:20 +02:00
x509asn1.c lib/src: white space edits to comply better with code style 2024-09-19 14:59:12 +02:00
x509asn1.h x509asn1: unittests and fixes for gtime2str 2024-07-30 23:08:59 +02:00