curl/lib/vtls
Stefan Eissing 2b3dfb4ad4
lib: make resolving HTTPS DNS records reliable:
- allow to specify when they are wanted on starting a resolve
- match dns cache entries accordingly. An entry which never
  tried to get HTTPS-RRs is no answer for a resolve that wants
  it.
- fix late arrivals of resolve answers to match the "async"
  records that started them - if it still exists.
- provide for multiple "async" resolves in a transfer at the
  same time. We may need to resolve an IP interface while the
  main connection resolve has not finished yet.
- allow lookup of HTTPS-RR information as soon as it is
  available, even if A/AAAA queries are still ongoing.

For this, the "async" infrastructure is changed:

- Defined bits for DNS queries `CURL_DNSQ_A`, `CURL_DNSQ_AAAA`
  and `CURL_DNSQ_HTTPS`. These replace `ip_version` which says
  nothing about HTTPS.
  Use them in dns cache entries for matching.
- enhance the `async->id` to be a unique `uint32_t` for
  resolves inside one multi. This is weak, as the id may
  wrap around. However it is combined with the `mid` of
  the easy handle, making collisions highly unlikely.
  `data->state.async` is only accessed in few places where
  the mid/async-id match is performed.
- vtls: for ECH supporting TLS backends (openssl, rustls, wolfssl),
  retrieve the HTTPS-RR information from the dns connection filter.
  Delay the connect if the HTTPS-RR is needed, but has not
  been resolved yet.

The implementation of all this is complete for the threaded
resolver. c-ares resolver and DoH do not take advantage of
all new async features yet. To be done in separate PRs.

Details:

c-ares: cleanup settings and initialisation. Any ares channel
is only being created on starting a resolve and propagating
operations in setopt.c to the channel are not helpful.

Changed threaded+ares pollset handling so that they do not
overwrite each others `ASYNC_NAME` timeouts.

Add trace name 'threads' for tracing thread queue and
pool used by threaded resolver.

Closes #21175
2026-04-01 15:36:31 +02:00
..
apple.c badwords: rework exceptions, fix many of them 2026-03-12 01:01:16 +01:00
apple.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
cipher_suite.c lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
cipher_suite.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
gtls.c gnutls: fix clang-tidy warning with !verbose 2026-03-22 19:15:56 +01:00
gtls.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
hostcheck.c lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
hostcheck.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
keylog.c build: drop redundant USE_QUICHE guards 2026-03-30 13:46:14 +02:00
keylog.h keylog.h: replace literal number with macro in declaration 2026-03-28 15:51:04 +01:00
mbedtls.c badwords: prefer 'null-terminated' 2026-03-18 11:40:13 +01:00
mbedtls.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
openssl.c lib: make resolving HTTPS DNS records reliable: 2026-04-01 15:36:31 +02:00
openssl.h boringssl: fix more coexist cases with Schannel/WinCrypt 2026-03-28 15:52:41 +01:00
rustls.c lib: make resolving HTTPS DNS records reliable: 2026-04-01 15:36:31 +02:00
rustls.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
schannel.c badwords: rework exceptions, fix many of them 2026-03-12 01:01:16 +01:00
schannel.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
schannel_int.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
schannel_verify.c badwords: rework exceptions, fix many of them 2026-03-12 01:01:16 +01:00
vtls.c dnscache: own source file, improvements 2026-03-21 12:04:36 +01:00
vtls.h urldata: import port types and conn destination format 2026-03-15 12:02:26 +01:00
vtls_int.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
vtls_scache.c docs: avoid starting sentences with However, 2026-03-07 23:49:11 +01:00
vtls_scache.h badwords: rework exceptions, fix many of them 2026-03-12 01:01:16 +01:00
vtls_spack.c lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
vtls_spack.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
wolfssl.c lib: make resolving HTTPS DNS records reliable: 2026-04-01 15:36:31 +02:00
wolfssl.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
x509asn1.c x509asn1: fixed and adapted for ASN1tostr unit testing 2026-03-20 13:03:40 +01:00
x509asn1.h x509asn1: fixed and adapted for ASN1tostr unit testing 2026-03-20 13:03:40 +01:00