Commit graph

38820 commits

Author SHA1 Message Date
Stefan Eissing
032b15c434
cf-setup: improve readability
Restructure the code in cf-setup connect to make it better readable what
is happening for establishing the connection's filter chain.

Closes #21827
2026-06-01 16:47:24 +02:00
Daniel Stenberg
c53426231d
setopt: CURLOPT_MAXCONNECTS set to 0 restores default value
Closes #21829
2026-06-01 16:46:10 +02:00
Stefan Eissing
12869080a1
data creds: detect change
Reshuffle code a little to detect when the transfer's credentials
actually change. Otherwise, leave the existing creds in place.

This gives the precise location where we may want to reset other
states that become invalid with change credentials. Also, by
keeping a creds instance as long as it is valid, we can associate
meta data with it.

Closes #21755
2026-06-01 16:42:10 +02:00
Daniel Stenberg
ff300ac4aa
setopt: defref the old referer when setting a new
Closes #21826
2026-06-01 15:23:04 +02:00
Viktor Szakats
6ff5c8ac4a
badwords: exclude wordlist input file from search
To avoid hitting all lines in it. It doesn't happen in curl at the
moment, but may happen in the future or in other projects using this
script.

Closes #21819
2026-06-01 15:07:17 +02:00
Viktor Szakats
5364e6e60e
cmake: add basic way to select pytests to run
Not documented and experimental, example:
`-D_CURL_PYTEST=/test_60_h3_proxy.py`

Ideally, this should be an env like `TFLAGS` and it should allow
selecting any test ID or a group of them, but so far could not figure
out how even a basic env could work.

Closes #21818
2026-06-01 15:07:17 +02:00
Viktor Szakats
2802e65f6d
pytest: pass --disable to curl
To avoid a local `.curlrc` interfering with tests.

Closes #21816
2026-06-01 15:07:17 +02:00
Viktor Szakats
d806323ffd
pytest: fixes and tidy-ups to h3-proxy tests
- merge tests into a single class.
  For shorter names, to fix sort order by test number, and to align with
  other tests.
- fix preconditions to make `test_60_04_guard_proxy_http3_unsupported`
  actually run.
- replace local precondition with constant of the same effect.
- drop redundant non-`ngtcp2` requirement for
  `test_60_04_guard_proxy_http3_unsupported`.
  (seemed relevant for no longer supported openssl-quic builds.)
- drop unused `NGTCP2_ONLY_MSG` constant.
  Follow-up to e4139a73c8 #21798
- avoid creating unnecessary test data blobs, and minimize their scopes.

Follow-up to 91facd7bb3 #21791
Follow-up to e78b1b3ecc #21153

Closes #21811
2026-06-01 15:07:17 +02:00
Daniel Stenberg
872c313d76
lib1560: drop unused variable 'url'
Spotted by Copilot

Closes #21821
2026-06-01 09:50:49 +02:00
Stefan Eissing
d3391229b0
vtls_config: adjust to origin
When a transfer goes against another origin than the initial one, do not
add the following to the ssl configuration: client cert, client key, srp
user/pass, pinned key.

Closes #21695
2026-06-01 09:39:17 +02:00
Daniel Stenberg
4beffe7737
Revert "tool: add a retry delay for transfers to same origin on 429"
This reverts commit c5fb460e7c.

This needs some further work before we can do this.

Fixes #21822
Closes #21824
2026-06-01 09:28:31 +02:00
Daniel Stenberg
8da87fcef1
RELEASE-NOTES: synced 2026-06-01 08:50:11 +02:00
htasta
c5fb460e7c
tool: add a retry delay for transfers to same origin on 429
Closes #21355
2026-06-01 08:40:58 +02:00
Daniel Stenberg
1b6724882c
urlapi: accept 0X prefix in IPv4 address as well
Extend test 1560 accordingly

Closes #21820
2026-05-31 23:44:30 +02:00
tiymat
780ccb256e
urlapi: drop base fragment on empty redirect
Extended test 1560 to verify

Fixes #21745
Closes #21763
2026-05-31 23:36:16 +02:00
Stefan Eissing
4ff212f8ed
url: connection reuse fixes for starttls
Add test_31_13 to check connection reuse on mixed --ssl-reqd setting.
For that add debug env var CURL_DBG_NO_USE_SSL_ON_FIRST to disable
--ssl-reqd for the first url. Check that the connection without SSL
from the first url is not reused on the second URL that requires it.

Tweak special ftp: protocol check to fail a DEBUGASSERT on mismatched
`use_ssl` settings as that should have been caught before in the
connection reuse matching (imap/smtp etc. do not have this extra check
and rely on the general part doing its job).

Closes #21665
2026-05-31 23:29:15 +02:00
Viktor Szakats
f1a6f190a6
badwords: prefer 'workaround' (without hyphen)
Closes #21807
2026-05-31 22:05:54 +02:00
renovate[bot]
621696d98c
GHA: update dependency ngtcp2/ngtcp2 to v1.23.0
Closes #21815
2026-05-31 18:40:25 +02:00
Stefan Eissing
24874a4f04
scorecard: add support for http: testing
Add option `--http-plain` to test against httpd without
using TLS.

Closes #21805
2026-05-31 16:58:11 +02:00
renovate[bot]
722b59b3ab
GHA: update dependency ngtcp2/nghttp3 to v1.16.0
Closes #21814
2026-05-31 14:17:14 +02:00
Viktor Szakats
6ac42e5691
h3-proxy: disable frequently failing pytests
- test_60_02_connect_tunnel_fail[fail_h1_over_h3_proxytunnel]
- test_60_02_connect_tunnel_fail[fail_h3_over_h2_proxytunnel]
- test_60_02_connect_tunnel_fail[fail_h3_over_h3_proxytunnel]
- test_60_03_h3_target_auto_connect_udp[proxy_h3]
- test_60_15_connect_timeout

Further flaky ones may be disabled in future commits.
All to be re-enabled after stabilizing them.

Follow-up to 59213f8248 #21789
Follow-up to e78b1b3ecc #21153

Closes #21803
2026-05-29 00:15:47 +02:00
Viktor Szakats
c37405cb06
h3-proxy: fix callback return values, and a typo in tests
- replace literal -1 with `NGHTTP3_ERR_CALLBACK_FAILURE` in nghttp3
  callback.
- replace `NGHTTP3_ERR_CALLBACK_FAILURE` with
  `NGTCP2_ERR_CALLBACK_FAILURE` in ngtcp2 callbacks.
- test_60_h3_proxy: fix non-critical typo in symbol.

Spotted by GitHub Code Quality

Follow-up to e78b1b3ecc #21153

Closes #21802
2026-05-28 23:32:33 +02:00
Daniel Stenberg
5e66176733
http: don't pass on set cookies to new origins
Verified by test 2015

Reported-by: azraelxuemo on hackerone

Closes #21794
2026-05-28 17:45:04 +02:00
Viktor Szakats
a0c559ff03
h3: fix signedness of two printf masks
Follow-up to c2ca16f3ff #21799
2026-05-28 17:42:14 +02:00
Viktor Szakats
c2ca16f3ff
h3: sync printf masks with types, drop two casts
Also fix `nwritten` signedness in `cb_h3_read_req_body()`.

Follow-up to e78b1b3ecc #21153
Ref: #20848

Closes #21799
2026-05-28 16:37:06 +02:00
Stefan Eissing
e4139a73c8
h3-proxy: fixes around H3 proxy
code:
- less exception handling in existing code
- true ip happy eyeballing
- enable certificate verification
- cf-h2-proxy: abort connection when server closed connection

tests:
- remove all --insecure and --proxy-insecure args
- make session reuse test_60_12 a working one
- resolve port conflicts between h2o and nghttpx
- use proxy args better
- make test_60_06 run shorter
- kill h2o at the end of tests, normal stop takes too long

Ref: 59213f8248 #21789
Follow-up to e78b1b3ecc #21153

Closes #21798
2026-05-28 14:41:27 +02:00
Viktor Szakats
59213f8248
GHA: enable H3 proxy in CI, also enable h2o tests on Linux
Also:
- GHA/http3-linux: enable deprecated APIs in openssl-prev local
  OpenSSL builds. Required by h2o and its vendored dependencies.
  Tried OpenSSL 4, LibreSSL 4.x, BoringSSL: all failed at one point.
- GHA/http3-linux: build h2o from source.
  libuv1-dev may not be stricly required.
  Tried installing libwslay-dev, but it wasn't recognized.
  Also disable building h2o libs for a much smaller dist directory and
  slightly faster build.
  Sadly, h2o is not versioned, so I pinned to the current latest commit
  at the master branch. It advertises itself as 2.3.0-DEV in pytest.
- drop redundant `libnghttp3` installs. Remains of openssl-quic builds.
  Follow-up to 6aaac9dd38 #20226

Note GHA/macos pytests may or not not be stable with the H3 proxy tests.

Follow-up to e78b1b3ecc #21153

Closes #21789
2026-05-28 14:31:32 +02:00
Viktor Szakats
cfa735c40a
h3-proxy: rename feature 'Proxy/PROXY-HTTP3' to 'proxy-HTTP3'
For consistency and to follow existing 'HTTPS-proxy' (with lowercase
'proxy') feature tag more closely.

Follow-up to e78b1b3ecc #21153

Closes #21796
2026-05-28 12:52:50 +02:00
Viktor Szakats
f2183f51b6
build: say 'experimental' in option descriptions
Also:
- INSTALL-CMAKE.md: alpha-sort enable options.
- cmake: sync a description between source and docs.

Closes #21795
2026-05-28 12:52:50 +02:00
Aritra Basu
91facd7bb3
tests/http: fix HTTP/3 proxy pytest failures with h2o
Fix pytest failures in HTTP/3 proxy tests when h2o is not installed,
misconfigured, or fails to start at runtime.

This prevents:
- FileNotFoundError when h2o document root does not exist
- Fixture setup errors when h2o is configured but cannot start
- Unused test data file creation when h2o is absent or broken
- CI aborts on systems where h2o exists but is not runnable

Bug: https://github.com/curl/curl/pull/21789#issuecomment-4559098879
Bug: https://github.com/curl/curl/pull/21789#issuecomment-4559161907

Follow-up to e78b1b3ecc #21153

Closes #21791
2026-05-28 10:38:58 +02:00
Viktor Szakats
9591ff123d
tidy-up: add space around operators, where missing
Closes #21793
2026-05-28 10:12:00 +02:00
renovate[bot]
de9bb509d1
GHA: update dependency google/boringssl to v0.20260526.0
Closes #21790
2026-05-28 09:59:58 +02:00
tiymat
f1959ae962
urlapi: fix an issue parsing file URLs
Fixes #21743
Closes #21764
2026-05-28 08:49:56 +02:00
ambikeesshh
e2ca8408c4
cf-socket: set scope_id for IPv6 link-local addresses
When connecting to an mDNS hostname that resolves to an IPv6 link-local
address, connect() fails with EINVAL because sin6_scope_id is 0. This is
a regression since 8.20.0 where the threaded resolver started splitting
A and AAAA queries into separate getaddrinfo calls. The AAAA-only call
with PF_INET6 may not set scope_id on systems where the same call with
PF_UNSPEC did.

When the resolver does not provide scope_id for a link-local address,
try to determine it from the system's network interfaces using
getifaddrs(). Also add scope_id to verbose connect output so the value
can be seen in curl -v logs.

Built and tested locally on Linux. checksrc passes.

Fixes #21669
Reported-by: Bartel Sielski
Closes #21728
2026-05-28 08:43:53 +02:00
Daniel Stenberg
6597e6d461
tftp: avoid the timeout calc if the timeout is crazy
Avoids integer overflow when a silly value is set.

Fixes #21782
Reported-by: Mike-menny on github
Closes #21787
2026-05-28 00:14:00 +02:00
Daniel Stenberg
d1b482caec
unit3400: repair after capsule_encap_udp_hdr went static
Access the static function with UNITTEST as designed.

Follow-up to 73c2b4b435

Closes #21788
2026-05-28 00:13:24 +02:00
Viktor Szakats
59320082b0
tidy-up: apply clang-format fixes
To lib, vtls/vauth, vtls/vquic, lib/vtls.

Also:
- unit3400: drop redundant `(void)arg`.
  Follow-up to e78b1b3ecc #21153
- fix comment typos.

Closes #21786
2026-05-28 00:05:47 +02:00
Viktor Szakats
cdb266738b
pytest: re-enable test test_05_01 and test_05_02 for quiche 0.29.0+
The upstream issue seems to have been fixed or mitigated in quiche
v0.29.0. Though the original upstream report and patch remain open at
the time of writing this.

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

Follow-up to 252b82f693 #21730
Follow-up to 91b422d356 #20952
Follow-up to 14478429e7 #19916

Closes #21784
2026-05-27 23:27:04 +02:00
Viktor Szakats
a5fcaa8553
m4: drop redundant conditions in TLS library detections
Omit checking `OPT_<BACKEND>` against `no` twice.

Also:
- openssl: drop stray `OPT_OPENSSL=off` check.
  Follow-up to 68d89f242c #6897
- rustls: drop no-op line.
  Follow-up to 9c42098370 #13202
- gnutls: fix casing in comment.
- merge `if` branches where possible after these changes.

Closes #21781
2026-05-27 23:26:20 +02:00
Viktor Szakats
15356f0d36
lib1560: fix to propagate failure from get_nothing()
Also:
- check `curl_url()` for NULL where missing.
- free memory `curl_url_get()` return pointer where missing.
- propagate `curl_url_set()` errors in `clear_url()`, where missing.
- add missing NULL-check before `strcmp()` in `clear_url()`.

Closes #21780
2026-05-27 23:26:20 +02:00
Daniel Stenberg
73c2b4b435
capsule: make capsule_encap_udp_hdr static
And drop the Curl_ prefix.

Closes #21777
2026-05-27 23:17:44 +02:00
Daniel Stenberg
98431e89bb
creds: remove two unused functions
Curl_creds_same_user and Curl_creds_same_password

Closes #21776
2026-05-27 23:16:51 +02:00
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