Commit graph

38778 commits

Author SHA1 Message Date
Daniel Stenberg
7bc2bf7917
http_proxy: make two proxy_create functions static
And drop their `Curl_` prefixes. They are only used within this file.

Closes #21775
2026-05-27 23:15:29 +02:00
Daniel Stenberg
ead2e13a8e
dnscache: remove Curl_dns_entry_link
Unused function

Closes #21774
2026-05-27 23:13:19 +02:00
Daniel Stenberg
4f8ed62c49
cf-h3-proxy.c: bring back include
Without it, it breaks regular (non-unity) builds.

Fix regression from 7e1001bcd6

Closes #21785
2026-05-27 23:12:27 +02:00
renovate[bot]
1c302362e0
GHA: update dependency cloudflare/quiche to v0.29.1
Closes #21783
2026-05-27 22:38:29 +02:00
Viktor Szakats
50b1408f97
autotools: mbedtls detection fixes
- fix symbol used for first-round detection.
- skip detecting mbedtls on custom path if custom path was not supplied.

Reported-by: Ross Burton
Fixes #21727

Closes #21729
2026-05-27 16:57:56 +02:00
Viktor Szakats
40f2da6ec3
vtls: more large buffer support and error checks for SHA-256
- gnutls: support 4GiB+ SHA-256 digest inputs.
- openssl: check success of low-level update/finish digest calls.
- openssl: pass NULL to `EVP_DigestFinal_ex()` instead of discarding
  returned value.
- wolfssl: support 4GiB+ SHA-256 digest inputs.
- wolfssl: check success of low-level update/finish digest calls.
- sync and tidy up argument names in low-level sha256_sum functions.

Closes #21771
2026-05-27 16:57:39 +02:00
Viktor Szakats
a1baacc670
schannel: check schannel_sha256sum() success, and more
Also:
- support 4GiB+ SHA-256 digest inputs.
- check `CryptGetHashParam()` output size.
- avoid overwriting existing digest when new digest calculation fails.
- avoid adding digest hash element on failure.

Closes #21739
2026-05-27 16:57:38 +02:00
Viktor Szakats
c7f0267eb7
curl_sha512_256: fix result code on error
Replace result code `CURLE_SSL_CIPHER` with
`CURLE_BAD_FUNCTION_ARGUMENT` in case of a low-level digest function
fails. Functionality is related to vauth, not SSL, and the operation is
a digest, not a cipher.

Also fix a indentation.

Follow-up to 05268cf801 #13070

Closes #21767
2026-05-27 16:57:38 +02:00
Viktor Szakats
7bcf34672d
vtls_spack: drop redundant macro fallbacks
For `UINT16_MAX` and `UINT32_MAX`. They are used in other sources
without this fallback.

Closes #21768
2026-05-27 16:53:57 +02:00
Viktor Szakats
4f31f076c2
INSTALL-CMAKE.md: document H2O config variable
Follow-up to e78b1b3ecc #21153

Closes #21769
2026-05-27 16:53:57 +02:00
Viktor Szakats
7e1001bcd6
tidy-up: miscellaneous
- H3 proxy: re-sync code with original source `curl_ngtcp2.c` to reduce
  differences, and to apply missed minor fixes. Also apply clang-format.
  Drop redundant `#undef`s, casts, `#endif` comments, includes, drop
  intermediate variables, sync include and macro order.
  Follow-up to e78b1b3ecc #21153
- INSTALL-CMAKE.md: move `CURL_ENABLE_SMB` to the enable section.
- tests/http/env: rename `tcpdmp` to `tcpdump` to match object variable.
- mbedtls: drop incorrect `mbedTLS 4+` comments.
  (features are also supported by 3+, meaning it's always supported.)
- lib1648: rename a variable to match purpose.
- CIPHERS.md: alpha-sort link list.
- replace rare `X''` hex markup with `0x`.
- `IP v4/6` -> `IPv4/6`.
- 'version X.Y' -> 'vX.Y', where sensible.
- 'VX.Y' -> 'vX.Y', where sensible.
- fix indents, casing, newlines, typos.

Closes #21772
2026-05-27 16:53:57 +02:00
Stefan Eissing
a7d4abb0cf
cf-h3-proxy: add SSL flag
Since the proxy filter does TLS, it needs to set the SSL flag.

Follow-up to e78b1b3ecc
Closes #21770

Spotted by Codex Security
2026-05-27 10:55:59 +02:00
Stefan Eissing
1791a08707
content_encoding: timeout during slow decoding
Check during transfer/content decoding for every MB or so, if the
transfer has reached its overall time limit. Error out if so.

This is mainly a protectin against compression bombs using way more time
than the transfer is allowed to. Normal compression ratios are unlikely
to benefit as they need more upstream data where the timeout handling is
already in place.

Fixes #21603
Reported-by: Joshua Rogers
Closes #21758
2026-05-27 09:52:48 +02:00
Stefan Eissing
049ec8a363
content_encoding: fix limit failure message
The message triggered earlier than intended and did not take the
transfer/content type into account.

Ref #21603
Reported-by: Joshua Rogers
Closes #21756
2026-05-27 09:50:34 +02:00
tiymat
a8e6f90a69
urlapi: forbid '|' in host
Closes #21762
2026-05-27 09:39:37 +02:00
Daniel Stenberg
efdf733bae
gtls: use the correct return code in trace output
Instead of using a hard-coded zero.

Spotted by Copilot

Closes #21766
2026-05-27 09:38:39 +02:00
Daniel Stenberg
23e4bd9602
RELEASE-NOTES: synced 2026-05-27 09:06:55 +02:00
Joshua Rogers
f21b5d4e66
gtls: fix ignored return and uninitialized status in OCSP check
gnutls_ocsp_resp_get_single() was called with (void) discarding its
return value, so a failure (e.g. an OCSP response with no
SingleResponse entries) went undetected.  The following switch() then
read an uninitialized gnutls_ocsp_cert_status_t, which is undefined
behaviour and could yield GNUTLS_OCSP_CERT_GOOD (0) depending on
stack contents, causing gtls_verify_ocsp_status to return CURLE_OK for
a response that was never successfully parsed.

Fix by initializing status to GNUTLS_OCSP_CERT_UNKNOWN and treating a
negative return from gnutls_ocsp_resp_get_single as an error.

Closes #21679
2026-05-27 09:01:00 +02:00
Aritra Basu
e78b1b3ecc
HTTP/3: add proxy CONNECT and MASQUE CONNECT-UDP support (ngtcp2 QUIC)
This patch adds two major proxy capabilities to curl (ngtcp2 QUIC):
- HTTP/3 Proxy CONNECT: Tunnel HTTP/1.1 or HTTP/2 traffic through an
  HTTPS proxy that speaks HTTP/3 (QUIC) using the standard CONNECT
  method over an HTTP/3 connection.
- MASQUE CONNECT-UDP: Tunnel HTTP/3 (QUIC) traffic through an HTTP
  proxy (speaking HTTP/1.1, HTTP/2, or HTTP/3) using the extended
  CONNECT method with the CONNECT-UDP protocol (RFC9297 & RFC9298).

Public API additions:
- `CURLPROXY_HTTPS3`: new proxy type constant for HTTP/3 proxy
- `--proxy-http3`: new CLI flag to negotiate HTTP/3 with HTTPS proxy

The implementation adds two new filters:
- `H3-PROXY` - enables negotiating HTTP/3 (QUIC) to the proxy and
  running CONNECT/CONNECT-UDP through that proxy transport.
- `CAPSULE` - dedicated filter inserted between QUIC transport and
  HTTP-PROXY to handle datagram capsule encapsulation/decapsulation.

Here is how the curl filter chaining looks in different scenarios:
- HTTP/3 Proxy CONNECT (tunneling TCP protocols over QUIC proxy):
  conn -> HTTP/1.1 or HTTP/2  -> SSL -> HTTP-PROXY ->
                                 H3-PROXY -> HAPPY-EYEBALLS -> UDP
- MASQUE CONNECT-UDP (tunneling QUIC over any proxy):
  conn -> HTTP/3 -> CAPSULE -> HTTP-PROXY -> H3-PROXY ->
                               HAPPY-EYEBALLS -> UDP
  conn -> HTTP/3 -> CAPSULE -> HTTP-PROXY -> H1-PROXY or H2-PROXY ->
                               SSL -> HAPPY-EYEBALLS -> TCP

- Both features currently require the ngtcp2 QUIC backend.
- Both features are experimental (disabled by default). Enable with
  `--enable-proxy-http3`(autotools) or `-DUSE_PROXY_HTTP3=ON`(CMake).

Tests:
- tests/unit/unit3400.c: Unit tests for capsule protocol encode/decode
- tests/http/test_60_h3_proxy.py: Comprehensive pytest integration suite
- tests/http/testenv/h2o.py: Managing h2o instances with HTTP/1.1, HTTP/2,
  and HTTP/3 (QUIC) listeners, proxy.connect and proxy.connect-udp enabled.

References:
  RFC 9297 - HTTP Datagrams and the Capsule Protocol
  RFC 9298 - Proxying UDP in HTTP
  RFC 9000 §16 — Variable-Length Integer Encoding

Signed-off-by: Aritra Basu <aritrbas+gh@cisco.com>

Closes #21153
2026-05-27 08:49:53 +02:00
Viktor Szakats
efc3f2309e
GHA: fix locale tests on macOS, extend to verify test 1981
- fix macOS locale tests to clear existing variables.
  (Without this, the system-defined `LC_ALL` takes precedence, and
  the custom envs in CI are ignored.)

- trigger test 1981 issue by setting `LC_TIME` to non-English, on macOS.
  (On Linux it'd require explicitly installing a non-English locale, I
  skipped this for simplicity.)
  ```
  [...]
  -Time: 01/Aug/2025 08:31:43.037103 +0000 UTC[CR][LF]
  +Time: 01/ao%c3%bb/2025 08:31:43.037103 +0000 UTC[CR][LF]
  [...]
  FAIL 1981: '%time output with --write-out' HTTP, HTTP GET
  ```
  Follow-up to 90a7732d46 #21749

Follow-up to 1cc8a5235f #17988
Follow-up to c221c0ee59 #17938

Closes #21753
2026-05-26 22:33:25 +02:00
Viktor Szakats
0cb455aa85
INSTALL-CMAKE.md: drop two obsolete sections
Follow-up to 89043ba906 #20407

Closes #21761
2026-05-26 21:59:48 +02:00
Viktor Szakats
2cc171cbd4
GHA: verify tarball downloads
Detect latest tarball version via the https://curl.se/downloads.html
page, download the signing key from a public keyserver then verify
source download signatures.

To ensure that public downloads are intact.

Closes #21759
2026-05-26 21:59:48 +02:00
Viktor Szakats
500820682c
GHA: require HTTPS protocol in redirections (where missing)
Also:
- drop following redirects on `openldap.org`.

Closes #21757
2026-05-26 21:59:48 +02:00
Stefan Eissing
90a7732d46
test1981: explicitly set the locale
Otherwise we may get a different month name in the output.

Closes #21749
2026-05-26 21:59:48 +02:00
Viktor Szakats
01d8191b25
GHA: bump LibreSSL to 4.3.2
Also switch back to ftp.openbsd.org download server. More often than not
the GitHub release entry is missing the download artifacts at the time
of detecting a new version, breaking automatic bumps. We cache the
download so it does not bang the origin server with many requests.

Follow-up to 800b0bec18 #19082
Closes #21742
Closes #21754
2026-05-26 15:23:43 +02:00
Stefan Eissing
f27233e984
GnuTLS: require 3.7.2 for earlydata
Since all API features we need for TLSv1.3 earlydata support do exist
only from version 3.7.2 onwards, make that the minimal version required.

Fixes #21750
Reported-by: Johannes Schlatow
Closes #21751
2026-05-26 13:41:21 +02:00
Stefan Eissing
eb8f31e18b
multi_ev: silence clang-tidy nonsense
About a "unnecessary define" - my ass.

Closes #21752
2026-05-26 13:01:30 +02:00
mik
32227f83b4
docs: fix odd wording in CONTRIBUTE.md
Found with AI assistance, verified manually

Closes #21705
2026-05-26 11:27:46 +02:00
Daniel Stenberg
5ab34cba42
multi: handle pause in multi socket callback
The mev_sh_entry object might be removed if curl_easy_pause() is called
from within the socket callback.

Introduced a 'magic' struct field to to 'mev_sh_entry' to make it easier
to programmatically detect/assert if the pointer is bad - in debug
builds.

Reported-by: Joshua Rogers
Closes #21748
2026-05-26 10:52:34 +02:00
Daniel Stenberg
862e8a74a8
transfer: clear referer when set to NULL
Verify in test 1649

Closes #21741
2026-05-26 10:04:40 +02:00
Daniel Stenberg
a4d8fd7a2a
VULN-DISCLOSURE-POLICY.md: emphasize the no email thank you part
Closes #21747
2026-05-26 10:00:22 +02:00
Stefan Eissing
230a986636
ldap: switch of chasing referrals
It is switched off in the OpenLDAP backend, so we should do the
same here.

Follow-up to cdc1da9120

Closes #21732
2026-05-25 17:02:43 +02:00
Joshua Rogers
0b8dbbc63c
libssh: map SSH_KNOWN_HOSTS_OTHER to CURLKHMATCH_MISMATCH
Host key type mismatch from libssh was incorrectly reported as missing,
causing key callbacks to accept instead of reject.

Reported by: Joshua Rogers (Aisle Research)
Closes #21724
2026-05-25 16:46:22 +02:00
Viktor Szakats
4102400028
GHA/http3-linux: fixup quiche cache
Closes #21740
2026-05-24 15:20:35 +02:00
Viktor Szakats
252b82f693
quiche: bump cloudflare/quiche to v0.29.0, update pytest workaround
Also:
- drop no longer necessary quiche build workaround.
- update build for boringssl's new location (since v0.29.0, it's no
  longer vendored) within the quiche tree.
- move boringssl install dir out of quiche tree, and shorten it.

Ref: https://github.com/cloudflare/quiche/issues/2277
Ref: https://github.com/cloudflare/quiche/pull/2278
Ref: #21620

Closes #21730
2026-05-24 14:16:38 +02:00
Max Dymond
dc8a87fc74 mailmap: cmeister2@gmail is primary for Max Dymond
I'd rather all my commits be attributed to cmeister2@gmail.com instead
of anything else; especially not my old Microsoft email address!

Closes #21735
2026-05-24 12:02:26 +02:00
Max Dymond
307cfd008b KNOWN_BUGS: remove stale Threads::Threads entry
The old CMake bug about exporting -lpthread instead of Threads::Threads
no longer matches current master. As of 2d546d239e
("cmake: use Threads::Threads imported target for POSIX Threads"),
the build now uses Threads::Threads and the generated CMake package
config resolves the dependency explicitly, so this KNOWN_BUGS entry is stale.

Closes #21734
2026-05-24 11:12:30 +02:00
Joshua Rogers
fc90bdbaf9 schannel: error on TLS 1.3-only with cipher list
The legacy SCHANNEL_CRED path cannot negotiate TLS 1.3. When TLS 1.3
is the only enabled protocol and a cipher list is set, fail instead of
silently downgrading to TLS 1.2.

Fixes https://github.com/curl/curl/issues/21702
Closes https://github.com/curl/curl/pull/21725
2026-05-22 11:22:15 -04:00
Jay Satiro
2ba0a0e41e CIPHERS.md: fix the example that uses only TLS 1.3
- Add --tls-max 1.3 to set the maximum version to TLS 1.3.

- Remove Schannel because it doesn't support TLS 1.3 ciphers since
  6238888.

Prior to this change the example set the minimum version to TLS 1.3 but
not the maximum version to TLS 1.3.

Ref: https://github.com/curl/curl/issues/21702

Closes https://github.com/curl/curl/pull/21719
2026-05-22 11:18:02 -04:00
Stefan Eissing
7b9613fa9b
ngtcp2: fail handshake directly
When certificate verification fails, error out of the handshake
callback, forcing ngtcp2 to stop processing the connection any further.

Closes #21712
2026-05-22 10:03:05 +02:00
Daniel Stenberg
f69405b38f
RELEASE-NOTES: synced 2026-05-22 09:48:59 +02:00
Stefan Eissing
bfbff7852f
http2: remove stream dependency tracking
The HTTP/2 feature is deprecated, few servers implement it and our
implementation is complicated by its state management. Make the two
CURLOPT_* involved a nop and deprecate them.

Closes #21723
2026-05-22 09:44:08 +02:00
11soda11
2056498625
KNOWN_BUGS.md: remove fixed GnuTLS <-> OpenSSL incompat bug
The entry is about GnuTLS not sending the client cert when it doesn't
match the `DN` the server requested.  OpenSSL does the opposite.

The issue was already fixed by #4958 and removed from KNOWN_BUGS,
but it was added back to the list by #16677, seemingly by mistake.

The issue is still fixed for GnuTLS >= 3.5.0.
As curl only supports GnuTLS >= 3.6.5, remove the bug entry from
KNOWN_BUGS.md

Fixes #21720
Closes #21722
2026-05-22 08:13:51 +02:00
Daniel Stenberg
7e350dd147
urlapi: fix redirect handling if CURLU_NO_GUESS_SCHEME is set
Verified by test 1967

Reported-by: Joshua Rogers
Closes #21721
2026-05-22 07:48:20 +02:00
Viktor Szakats
8e549fbdd3
GHA/checksrc: add auditor-level zizmor (warning-only)
CI time cost is 1s.

It may replace existing pedantic check, if this level isn't bringing
false-positives or annoyance. Officially it's not meant for CI, but curl
has been passing this in the last couple of months when checked locally.

Closes #21718
2026-05-21 22:17:34 +02:00
Viktor Szakats
bb5500a752
units: tidy up begin/end blocks
- use `UNITTEST_BEGIN_SIMPLE`/`UNITTEST_END_SIMPLE` where missing.
- drop redundant `(void)arg;` where using `UNITTEST_BEGIN*`.
- unit1636: drop redundant block after `UNITTEST_BEGIN*`.
- unit1609: fix typo in comment.
- unit1627: merge to `if`s.

Closes #21715
2026-05-21 17:28:38 +02:00
Viktor Szakats
a076f821e1
multi: silence gcc 16 -Wnull-dereference, bump CI job to test
- GHA/windows: bump dl-mingw job from gcc 15 to 16.

- multi: silence warning while building libcurlu:
  ```
  In function 'multi_ischanged',
      inlined from 'multi_socket.isra' at D:/a/curl/curl/lib/multi.c:3282:6:
  D:/a/curl/curl/lib/multi.c:1710:17: error: null pointer dereference [-Werror=null-dereference]
   1710 |   bool retval = (bool)multi->recheckstate;
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
  D:/a/curl/curl/lib/multi.c:1712:25: error: null pointer dereference [-Werror=null-dereference]
   1712 |     multi->recheckstate = FALSE;
        |                         ^
  ```
  Ref: https://github.com/curl/curl/actions/runs/26217071531/job/77142119137?pr=21707

- multi: silence another `-Wnull-dereference`, popping up in libcurl
  with gcc 13 after the previous silencing:
  ```
  In function 'Curl_multi_xfers_running',
      inlined from 'multi_socket.isra' at ../../lib/multi.c:3292:28:
  ../../lib/multi.c:4132:15: error: null pointer dereference [-Werror=null-dereference]
   4132 |   return multi->xfers_alive;
        |          ~~~~~^~~~~~~~~~~~~
  ```
  Ref: https://github.com/curl/curl/actions/runs/26218822231/job/77148186045

- multi: also add `DEBUGASSERT(multi)` to the two updated functions.

Closes #21707
2026-05-21 15:16:21 +02:00
Viktor Szakats
64c51ad178
cmake: opt in MSVC_VERSION 1951 to picky warnings
Closes #21714
2026-05-21 15:16:21 +02:00
Viktor Szakats
b0239417b3
GHA/windows: bump windows-2025 runners to windows-2025-vs2026
To silence:
```
NOTICE: windows-2025 requests are being redirected to windows-2025-vs2026 by June 15, 2026
```

Closes #21713
2026-05-21 14:57:05 +02:00
Viktor Szakats
c583e825f7
GHA: simplify boolean if comparisons
Closes #21709
2026-05-21 14:13:52 +02:00