Commit Graph

38398 Commits

Author SHA1 Message Date
Daniel McCarney
0a7e1982fe
tests/http: add abrupt server close test
Test that connecting to a server that immediately closes the connection
produces an error instead of hanging/timing out.
2026-04-10 15:58:39 +02:00
kpcyrd
ce05754c7c
rustls: handle EOF during initial handshake
Closes #21242
2026-04-10 15:58:31 +02:00
Stefan Eissing
a5542c23e7
pytest: adding support for dnsd test server
Add tests to test_21 with checks for 'overrride-dns' from curlinfo.

Closes #21289
2026-04-10 14:29:29 +02:00
Stefan Eissing
7c8f11e953
pytest: switch off h3 for pytest_07_22
Run test_07_22 only on http/1.1 and h2. For h3, we get unreliable tests
results in CI due to (probably) nghttpx not always reporting the RESET
from the backend and the test timing out.

Closes #21286
2026-04-10 12:39:51 +02:00
Viktor Szakats
6e40c3ed48
vquic: fix variable name in fallback code
Could not cause an issue in practice.

Closes #21281
2026-04-10 12:10:23 +02:00
Daniel Stenberg
e5087ac9fc
http: on 303, switch to GET
... unless it is a POST and the user explicitly asked to keep doing
POST.

Add test1983/1984: verify --follow with 303 and PUT + custom GET

Fixes #20715
Reported-by: Dan Arnfield
Closes #21280
2026-04-10 09:39:39 +02:00
Daniel Stenberg
bb3670f929
tool: simplify retrycheck()
- By making retry_sleep() a separate funtion that determines how long to
  wait until the next retry.

- switch the retry timer to uint32 to make it uniform across platforms

Closes #21279
2026-04-10 09:38:15 +02:00
renovate[bot]
008aa2b38f
GHA: update awslabs/aws-lc to v1.71.0
Closes #21283
2026-04-10 08:21:48 +02:00
Viktor Szakats
7d49f47fcb
RELEASE-NOTES: fix typos [ci skip] 2026-04-10 00:10:58 +02:00
Stefan Eissing
ef49d42a2c
cfilters: CF_TYPE_SETUP connection filter
Connection filters can now carry the flag CF_TYPE_SETUP, indicating that
they are only needed during connection setup, e.g. connect.

Once the connection is fully established, those filter are removed
again. This frees resources and also makes the filter (call) chains
shorter.

Closes #21269
2026-04-09 14:10:28 +02:00
Stefan Eissing
a28540787c
asyn-ares: connect async
Make separate queries for A and AAAA records. Hand out A/AAAA/HTTPS
information before all queries are complete.

Closes #21205
2026-04-09 09:32:12 +02:00
Stefan Eissing
d99df64405
h3: HTTPS-RR use in HTTP/3
When HTTPS-RR is needed for the HTTP/3 handshake, delay the connect
until it arrives. Relevant only for TLS backends that support ECH, for
now.

Closes #21253
2026-04-09 09:30:52 +02:00
dependabot[bot]
3bde26dac8
tests/http: bump cryptography from 46.0.6 to 46.0.7
Closes #21273
2026-04-09 02:13:34 +02:00
renovate[bot]
8a3de6c8ce
GHA: update dependency wolfSSL/wolfssl to v5.9.1
Closes #21272
2026-04-08 23:32:25 +02:00
Viktor Szakats
1737e47f59
build: skip detecting pipe2() for Apple targets
To avoid (mis-)detecting it via the internal Apple library
`/usr/lib/system/libsystem_sim_kernel.dylib` when targeting iPhone
Simulator (seen with iPhoneSimulator26.4.sdk).

Reported-by: Ian Spence
Fixes #21236

Closes #21271
2026-04-08 23:32:25 +02:00
Stefan Eissing
567803db79
dns: https-eyeballing async
Make cf-https-connect work async correctly:
- only start first baller when at least one A/AAAA address
  is available
- select first connect attempt after that with HTTPS-RR info
  there or not.
- select second connect attempt only when HTTPS-RR is resolved
  (may have resolved to "not known") and select possible ALPN
  from things known by then. May not select any second attempt
  when first already covers everything.

This means when the HTTPS-RR is known at/before the first address
is resolved, everything behaves as before. When the HTTPS-RR is
late, a first connection attempt will have been started. Any
ALPN preference from the HTTPS-RR that is not already ongoing will
then start the second attempt.

For HTTPS-RRs that recommend 2 or more ALPNs, the first will always
be attempted: either it is already ongong or it will be the ALPN
for the second attempt. The 2nd ALPN recommendation from HTTPS-RR
*may* be honored or not, depending on what is already selected.

The difference in behaviour between early/late HTTPS-RR resolve
cannot be helped - unless we do not perform any attempts before
it arrives. Trade offs.

Closes #21267
2026-04-08 23:15:39 +02:00
Dan Fandrich
17e8200733 tests: make whitespace between functions and classes consistent
Mostly, this means two blank lines between classes and functions and one
line between methods. Since these checks are currently in preview, they
are done in a separate ruff invocation to avoid turning ALL the preview
checks on at the same time.
2026-04-08 10:28:05 -07:00
Dan Fandrich
98e470b3a8 tests: alphabetize and group Python imports & add check
- De-duplicates, groups, and sorts imports based on the provided `isort` settings.
2026-04-08 10:28:05 -07:00
Dan Fandrich
4c1b6f5494 tests: enable more ruff checks
- Checks for missing explicit `return` statements at the end of functions
that can return non-`None` values.
- Checks for classes that inherit from `object`.
- Checks for useless expressions.
- Within an `except*` clause, raise exceptions with `raise ... from err`
or `raise ... from None` to distinguish them from errors in exception
handling
- Checks for variable assignments that immediately precede a `return` of the
assigned variable.
- Checks for `else` statements with a `return` statement in the preceding
`if` block.
- Checks for unnecessary parentheses on raised exceptions.

Closes: #21258
2026-04-08 10:28:05 -07:00
Daniel Stenberg
698eee1b95
vtls_scache: include cert_blob independently of verifypeer
The making of the TLS session cache key should use the cert blob
independently of verifypeer on/off.

Follow-up to fa0ccd9f1f

Spotted by Codex Security

Closes #21222
2026-04-08 15:18:45 +02:00
Daniel Stenberg
283db12e05
parsedate: bsearch the time zones
There are 69 entries, bsearch is faster than linear search for random
access.

This now also makes the matching case sensitive (zone names always in
uppercase). No docs said otherwise and all tests assumed uppercase.

Extended test 517

Closes #21266
2026-04-08 12:00:59 +02:00
Viktor Szakats
5d84aa41a0
RELEASE-NOTES: update the entry for mk-ca-bundle.pl [ci skip]
To dsecribe the feature remaiming after follow-up commits.

Follow-up to 351e4f956a #21116
2026-04-08 11:41:55 +02:00
Daniel Stenberg
c0e7f70218
RELEASE-NOTES: synced 2026-04-08 11:33:11 +02:00
Daniel Stenberg
59c8de7897
mbedtls: fix ECJPAKE matching
It did not require a full-length match, so empty or prefix tokens map to
ECJPAKE would silently add that cipher to the configured list.

Follow-up to fba9afebba

Reported by Codex Security

Closes #21264
2026-04-08 11:27:31 +02:00
Ted Lyngmo
135665036f
docs: use the correct CURLOPT_WRITEFUNCTION signature
In order to not encourage users to use incompatible function pointers,
change the callback function definitions to use `char *` instead of
`void *` for the first argument.

Triggered by https://stackoverflow.com/questions/79921871/curl-c-c-library-based-application-produces-erronious-response-for-http-post-r#comment141032037_79921871 :

"The code was mostly modified from
 [this example code](https://curl.se/libcurl/c/postinmemory.html),
 honestly I never knew this is wrong. Thanks for pointing it out."

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
Closes #21265
2026-04-08 11:25:54 +02:00
Daniel Stenberg
80b2a5dd37
tool_getparam: reduce opt_string complexity
- move arguments taking unsigned numbers into opt_num

- move arugments taking seconds into opt_secs

Closes #21261
2026-04-08 08:03:16 +02:00
Viktor Szakats
4c9af8b6d1
configure: silence useless clang warnings in C89 builds
Syncing with CMake.

Follow-up to 43397b0283 #21015
Follow-up to 09c9afdd71 #20363

Closes #21263
2026-04-08 03:51:54 +02:00
Viktor Szakats
f82ed74ed6
GHA/linux: bump mbedTLS 3 to 3.6.5 (from 3.6.4), also verify hash
Also:
- fix incorrect version in cache id.
  Follow-up to 3a305831d1 #19077
- latest version 3.6.6 fails pytests. Seems similar to the v4.1.0
  regression.
  https://github.com/curl/curl/pull/21178
  https://github.com/Mbed-TLS/mbedtls/issues/10668

Closes #21262
2026-04-08 02:31:44 +02:00
Viktor Szakats
b2a767dbce
gtls: fail for large files in load_file()
Used for issuer certs. Limit the size at `CURL_MAX_INPUT_LENGTH`, 8MB.

Bug: https://github.com/curl/curl/pull/21256#discussion_r3045854654

Closes #21257
2026-04-07 20:04:44 +02:00
Viktor Szakats
d3dc5dbc87
clang-tidy: avoid assigments in if expressions
Also enable check in clang-tidy.

Cherry-picked from #20794

Closes #21256
2026-04-07 16:57:46 +02:00
Daniel Stenberg
3536730f33
parsedate: clarify time2epoch and add more variations to test 517
Polish the time2epoch function to become a little more readable.

Corrected the military time zones: they were going in the wrong
direction.

Add more curl_getdate() input varations to test 517

Closes #21251
2026-04-07 16:32:22 +02:00
Daniel Stenberg
09f9035045
clang-tidy: drop readability-math-missing-parentheses
It's mostly annoying and not helpful
2026-04-07 16:32:22 +02:00
Stefan Eissing
db9b6fa82e
cf-ip-happy: limit concurrent attempts
Introduce a limit on the concurrent connect attempts of 6:

- document this in CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
- close the oldest attempt before opening a new one that would
  exceed the limit
- closing failed attempts early to avoid sockets use beyong their
  usefulness
- add tests for limits in unit2600

These changes are externally visible as file descriptors will be
reassigned where we previously kept the old one around and started a
new socket, allocating always a new descriptor.

Closes #21252
2026-04-07 16:26:25 +02:00
renovate[bot]
44c19a2cce
GHA: update openssl/openssl to v3.6.2
Closes #21254
2026-04-07 16:09:51 +02:00
Daniel Stenberg
b168fc79ff
libssh: split myssh_statemach_act into sub functions and rename
Follow-up to bd3b2a626a

- rename it to myssh_statemachine

- remove the use of ternary operators in the switch

- fix the error handling for if 'sshp' actually ever is NULL

Closes #21250
2026-04-07 15:59:04 +02:00
Daniel Stenberg
a20989b82c
libssh2: split ssh_statemachine into more sub functions
The pieces of the state machine that were not separate functions before, now
are.

Also removed the use of ternary operators in the function calls.

Follow-up to f0bf43e209

Closes #21249
2026-04-07 14:50:42 +02:00
Daniel Stenberg
74a169575d
protocol: disable connection reuse for SMB(S)
Connections should only be reused when using the same "share" (and
perhaps some additional conditions), but instead of fixing this flaw,
this change completely disables connection reuse for SMB. This protocol
is about to get dropped soon anyway.

Reported-by: Osama Hamad
Closes #21238
2026-04-07 13:23:01 +02:00
Viktor Szakats
a0d5d8fea3
curl_ntlm_core: use wolfCrypt DES API with wolfSSL
Replacing the last uses of the OpenSSL compatibility API, and dropping
the redefinition of external symbols.

Closes #21247
2026-04-07 11:58:30 +02:00
Viktor Szakats
f974a00aba
lib: replace PRI*32 printf masks with C89 ones
Also: fix indent.

Follow-up to 13c1a93414 #20215

Closes #21234
2026-04-07 11:58:30 +02:00
renovate[bot]
f1e3091923
Dockerfile: update debian:bookworm-slim Docker digest to 4724b8c
Closes #21248
2026-04-07 07:50:19 +02:00
Daniel Stenberg
be92f0a2e4
lib: reserve 'result' for CURLcode, even more
Closes #21245
2026-04-07 07:48:58 +02:00
Viktor Szakats
fc3261b284
cmake: pre-fill HAVE_PIPE2 for two more platforms
For DragonFlyBSD and SunOS.

Also opt-in `BSD`, which is covering those listed explicitly, when using
CMake 3.25+.

Follow-up to 131a2fd5aa #16987

Closes #21243
2026-04-07 00:33:48 +02:00
Daniel Stenberg
9f5d1a38d1
lib: reserve 'result' for CURLcode
For consistency, whereever we use a local variable named 'result' that
is a CURLcode type. Make other types use other names.

Closes #21244
2026-04-06 23:12:06 +02:00
Daniel Stenberg
4cb4f9d602
cfilters: fix Curl_pollset_poll() return code mixup
Curl_conn_cf_poll did not map adjust_pollset failures to poll-style
errors properly, so error codes were treated as ready events.

Found by Codex Security

Closes #21231
2026-04-06 22:09:03 +02:00
Viktor Szakats
ecd09257d8
GHA/curl-for-win: drop certdata dependency and GITHUB_TOKEN with it
`certdata` dependency requires accessing api.github.com for
a reproducible timestamp, which in turn requires a GitHub token to avoid
errors due to rate limiting. Avoid all this by omitting this dependency,
which isn't necessary for these build tests anyway.

The `zero` job already did not use `certdata`, but disable explicitly
anyway just in case.

Reported-by: James Fuller

Follow-up to 9514184977
Follow-up to 128c252975 #21105

Closes #21241
2026-04-06 18:49:13 +02:00
Viktor Szakats
596f685da5
GHA: autoreconf downloaded tarballs where missing
To avoid using pre-built `./configure` scripts.

Also: drop unrecognized nettle `./configure` option.

Closes #21240
2026-04-06 18:49:13 +02:00
Viktor Szakats
7b96563a05
spacecheck.pl: fix to check 3+ newlines in all files
Follow-up to e52e6dac8e #20269

Closes #21237
2026-04-06 04:05:58 +02:00
Viktor Szakats
e078485b36
cmake: drop redundant condition
Follow-up to 43397b0283 #21015
Cherry-picked from #21000
2026-04-06 02:52:08 +02:00
Viktor Szakats
6e9df9f111
Makefile.am: replace stray := with = [ci skip]
`=` is used everywhere else in `Makefile.am` files.

Cherry-picked from #21000
2026-04-06 02:52:08 +02:00
Viktor Szakats
5fdb35a3bc
curl_setup.h: drop stray/unused USE_OPENSSL_QUIC guard
Follow-up to 6aaac9dd38 #20226

Closes #21235
2026-04-05 22:03:50 +02:00