Commit graph

38418 commits

Author SHA1 Message Date
Daniel Stenberg
99ead4e0f0
request: cleanup the auth headers on soft rest as well
To avoid the risk them lingering around.

Follow-up to 3512b673dd

Closes #21311
2026-04-14 11:24:21 +02:00
renovate[bot]
67795ff730
GHA: update dependency google/boringssl to v0.20260413.0
Closes #21310
2026-04-14 11:04:10 +02:00
Daniel Stenberg
def4d8986e
http: use header_has_value() instead of duplicate code
Closes #21302
2026-04-14 10:16:43 +02:00
dependabot[bot]
bcb02fe526
GHA: bump pytest from 9.0.2 to 9.0.3
CVE-2025-71176

Closes #21306
2026-04-14 02:27:15 +02:00
Viktor Szakats
7b787f5995
KNOWN_BUGS: Native CA roots incomplete on Windows with OpenSSL/fork
Reported-by: finkjsc on github
Reported-by: nitrogene on github
Ref: #12303
Closes #20897

Closes #21305
2026-04-14 02:20:16 +02:00
Viktor Szakats
df6014894b
clang-tidy: enable more checks, fix fallouts
- enable three checks:
  - bugprone-invalid-enum-default-initialization
  - bugprone-sizeof-expression
  - readability-inconsistent-declaration-parameter-name (strict)
- fix remaining discrepancies with arg names in prototypes
  and implementation, in strict mode.
- document reason for some checks tested but not enabled.

Closes #20794
2026-04-14 02:20:16 +02:00
Viktor Szakats
e0dd6eb4a4
tidy-up: miscellaneous
- examples: sync debug output printf masks.
- INSTALL-CMAKE.md: tidy up section for some options.
- curl_sha512_256: delete comment suggesting an optimization.
- vtls/keylog: scope a variable.
- vtls/openssl: make a source code URL a permalink.
- vtls/schannel: drop redundant parentheses.
- test1119.pl: robustify `$1` -> `$s`.
- sync arg names in comments to match the code.
- tidy up and minor fixes to comments.
- fix formatting/indenting/comment/newline/include nits.
- move `UNITTEST` protos next to definitions, sync their argument names.
- make variables static.
- add parentheses to Perl `open()` calls.
- drop unnecessary double quotes in Perl.
- clang-format.

Closes #21000
2026-04-14 01:08:32 +02:00
Daniel Stenberg
3512b673dd
lib: move request specific allocations to the request struct
To make it clearer that they are ephemeral.

Closes #21301
2026-04-13 23:23:34 +02:00
Daniel Stenberg
7a349b5eed
setopt: fix typos in comments
Closes #21303
2026-04-13 23:12:05 +02:00
Daniel Stenberg
9ded494f0e
test1560: add a few more URL API test variations
Closes #21294
2026-04-13 21:58:55 +02:00
Stefan Eissing
40d57c9f58
hostip: resolve user supplied ip addresses
When a user supplied an ip address in a URL as hostname, use that even
when address family restrictions like -4 or -6 are set.

Add test_10_15/16 to verify with a local proxy server.

Fixes #21146
Reported-by: Terrance Wong

How:
- cf-dns: on see the hostname is an ip(v6) address, add the respective
  A/AAAA to the dns query bits
- cf-dns/hostip: only hand out addrinfos for a family if that family
  is part of the DNS queries. That prevents for example ipv6 addresses
  to show up from dns cache entries
- change cf-ip-happy to no longer check for "ip_version" and instead
  use all addresses that cf-dns hands out

Closes #21295
2026-04-13 19:52:30 +02:00
Daniel Stenberg
ec445fc595
setopt: move CURLOPT_CURLU
To fix cast from 'char *' to 'CURLU *' (aka 'struct Curl_URL *')
increases required alignment from 1 to 8

Follow-up to 3407bee8c8

Closes #21298
2026-04-13 14:34:16 +02:00
Jay Satiro
70bb0db767 schannel: increase renegotiation timeout to 60 seconds
Prior to this change the timeout was 7 seconds but that is too short for
enhanced-security users that have to fill out an interactive prompt on
Schannel renegotiation (PIN, smart card, etc).

Reported-by: Tim Omta

Fixes https://github.com/curl/curl/issues/21270
Closes https://github.com/curl/curl/pull/21291
2026-04-13 02:12:16 -04:00
Daniel Stenberg
3b68c67be2
RELEASE-NOTES: synced 2026-04-13 08:08:19 +02:00
Stefan Eissing
afdd8f1290
http: fix auth_used and auth_avail
Fix http auth to set the `picked` auth when sending the corresponding
headers. Fix reporting Digest as avail.

Fixes #21274
Reported-by: sergio-nsk on github
Closes #21284
2026-04-11 17:33:03 +02:00
Stefan Eissing
a483128b01
pytest: test threaded resolver
Add `resolv-threaded` to curlinfo to detect use of the threaded resolver
correctly even with c-ares linked to https-rr.

Run test_21_05 exactly when threaded resolver is built.

Closes #21287
2026-04-11 17:31:56 +02:00
Daniel Stenberg
879209fc88
unit1398: add msnprintf tests with negative precision
Closes #21292
2026-04-11 17:22:22 +02:00
Daniel Stenberg
3e40ccb875
getinfo: repair CURLINFO_TLS_SESSION
This should return a SSL_CTX pointer but it was accidentally broken.

Verify with test 1587

Follow-up to 2db8ae480f

Spotted by Codex Security

Closes #21290
2026-04-11 16:56:22 +02:00
renovate[bot]
935e1f9963
GHA: update dependency ruff to v0.15.10
Closes #21282
2026-04-11 02:21:33 +02:00
Viktor Szakats
8a3991e050
configure: tidy up comments
- convert `#` comments to `dnl`, except copyright headers, and inline
  comments in `curl-complilers.m4`.
- drop empty comments.
- drop line-ending `dnl` markers. (except `zz40-xc-ovr.m4` where it's
  used to produce a comment in `configure`.)
- replace `dnl` line with C comment in `AC_CHECK_HEADERS()`.

Verified to produce the same `configure` script except empty lines,
`#` comments, and C comments, with autoreconf 2.72.

Cherry-picked from #21000

Closes #21246
2026-04-10 23:19:41 +02:00
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