Commit graph

39511 commits

Author SHA1 Message Date
Daniel Stenberg
7be1e70cb6
vtls: move 'native_ca_store' ssl_config_data => ssl_primary_config
Some checks failed
Linux HTTP/3 / CM libressl (push) Has been cancelled
Linux HTTP/3 / CM quiche (push) Has been cancelled
Linux HTTP/3 / CM openssl-prev (push) Has been cancelled
Linux HTTP/3 / CM openssl (push) Has been cancelled
Linux HTTP/3 / CM wolfssl (push) Has been cancelled
Windows / cygwin, AM x86_64 openssl R (push) Has been cancelled
Windows / cygwin, CM x86_64 openssl (push) Has been cancelled
Windows / msys2, AM x86_64 !proxy (push) Has been cancelled
Windows / msys2, AM x86_64 default (push) Has been cancelled
Windows / mingw, AM x86_64 default (push) Has been cancelled
Windows / mingw, AM ucrt-x86_64 wolfssl c-ares U (push) Has been cancelled
Windows / msys2, AM x86_64 default R (push) Has been cancelled
Windows / mingw, CM ucrt-x86_64 openssl uwp (push) Has been cancelled
Windows / mingw, CM clang-aarch64 schannel R (push) Has been cancelled
Windows / mingw, CM i686 MultiSSL R (push) Has been cancelled
Windows / mingw, CM clang-x86_64 gnutls libssh (push) Has been cancelled
Windows / mingw, CM x86_64 schannel c-ares U (push) Has been cancelled
Windows / mingw, CM ucrt-x86_64 schannel U torture 1 (push) Has been cancelled
Windows / mingw, CM ucrt-x86_64 schannel U torture 2 (push) Has been cancelled
Windows / mingw, CM x86_64 schannel dev debug (push) Has been cancelled
Windows / msys2, CM x86_64 default (push) Has been cancelled
Windows / mingw, CM clang-x86_64 openssl (push) Has been cancelled
Windows / dl-mingw, CM 6.4.0-i686 schannel !unity (push) Has been cancelled
Windows / dl-mingw, CM 4.8.1-x86_64 schannel !examples (push) Has been cancelled
Windows / dl-mingw, CM 9.5.0-x86_64 schannel (push) Has been cancelled
Windows / dl-mingw, CM 16.1.0-x86_64 schannel +analyzer (push) Has been cancelled
Windows / dl-mingw, CM 7.3.0-x86_64 schannel mbedtls U (push) Has been cancelled
Windows / msvc, CM arm64-windows schannel U (push) Has been cancelled
Windows / msvc, CM x64-uwp !ssl +examples (push) Has been cancelled
Windows / msvc, CM x64-windows openssl +examples (push) Has been cancelled
And include it as key for connection reuse matching.

Reported-by: Stanislav Fort

Closes #22668
2026-08-25 17:01:00 +02:00
Daniel Stenberg
7ea37abc6a
openssl: avoid conn reuse if provider is used
Reported-by: Stanislav Fort

Closes #22665
2026-08-25 16:26:31 +02:00
renovate[bot]
c9ecd8f8df
GHA: update openssl/openssl to v4.0.2
Closes #22670
2026-08-25 16:07:19 +02:00
Stefan Eissing
d1702a24b3
ngtcp2+openssL: fix early data
Openssl needs an additional call into its API at just the right time to
*really* enable early data use. Add checks after handshake if early data
was really successful, more stringent than we used before.

test_02_32: enable early data test wiht more backends and platforms to
see how CI now copes with it.

Fixes #22649
Closes #22657
Reported-by: Rarylson Freitas
2026-08-25 15:52:39 +02:00
Daniel Stenberg
5267ed859d
openssl: no server cert is only okay if also not pinned
Reported-by: Stanislav Fort
Closes #22660
2026-08-25 13:27:26 +02:00
renovate[bot]
a8defa2a5e
Dockerfile: update debian:bookworm-slim Docker digest to 8820086
Closes #22663
2026-08-25 11:15:52 +02:00
Viktor Szakats
fb22f58cc3
cmake: optimize OpenSSL fork detection
Stop detecting further forks if one has been positively identified.

Closes #22664
2026-08-25 11:13:02 +02:00
Viktor Szakats
81dcba3549
cmake/FindLibgsasl: fix to set LIBGSASL_VERSION with pkg-config detection
Follow-up to 16f073ef49 #16973

Closes #22662
2026-08-25 11:13:02 +02:00
felix h
3ca86602ef spnego_sspi: pass channel bindings on initial context
HTTP Negotiate can create and send a Kerberos token before receiving a
server challenge. The SSPI backend only supplied Schannel endpoint
bindings when a challenge token was present, causing IIS with EPA
enabled to reject preemptive Kerberos authentication with
STATUS_BAD_BINDINGS.

Build the SSPI input descriptor independently of the challenge token so
Schannel endpoint bindings are included on both initial and subsequent
InitializeSecurityContext calls.

Assisted-by: martin-fzi@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/22466
Closes https://github.com/curl/curl/pull/22537
2026-08-25 03:44:46 -04:00
11soda11
67221a7882 tool_doswin: don't use TerminateThread in stdin relay
It is a dangerous function. Remove usage by only starting
the thread after setup completed successfully.

Ref: https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread
Ref: https://github.com/curl/curl/pull/21467#discussion_r3173013432
Ref: https://github.com/curl/curl/pull/18996#issuecomment-3389155817
Ref: https://github.com/curl/curl/pull/18451
Follow-up to 9a26633 #17572

Closes https://github.com/curl/curl/pull/22383
2026-08-25 03:39:15 -04:00
Daniel Stenberg
c2ce945ac0
vtls_scache: use case sensitive path match
Provided-by: 1rhino2 on hackerone
2026-08-25 07:48:21 +02:00
Daniel Stenberg
2687751471
protocol: simpler Curl_getn_scheme runs faster
Iterating unit test 1627 50,000 times show the new version to be 31%
faster on my machine.

- unit1627: add more test strings, In particular three, five and six letter
  non-existing schemes.

- remove scripts/schemetable.c, not used anymore

Closes #22658
2026-08-24 22:57:40 +02:00
Viktor Szakats
c2676bf9e6
vssh: silence gcc-11 -Wnull-dereference, dedupe CURL_EASY_STR() calls
Silencing:
```
In file included from libcurl_unity.c:179:
vssh/vssh.c: In function ‘Curl_ssh_setup_pkey.part.0’:
vssh/vssh.c:423:50: error: potential null pointer dereference [-Werror=null-dereference]
  423 |        CURL_EASY_STR(data, STRING_SSH_PUBLIC_KEY)[0]) {
libtool: compile:  gcc -DHAVE_CONFIG_H -I../include -I../lib -I../lib -I. -DBUILDING_LIBCURL -DCURL_STATICLIB -DUNITTESTS -D_GNU_SOURCE -Werror-implicit-functi
```
Ref: https://app.circleci.com/pipelines/gh/curl/curl/20825/workflows/c3eb591b-5a7d-40da-baa8-d2d9980b0cb2/jobs/181277

Follow-up to c8df3defd9 #22628

Closes #22656
2026-08-24 12:28:57 +02:00
Viktor Szakats
50bd20abb2
circleci: bump images to their latest revision
Ref: https://circleci.com/developer/images?imageType=machine

Closes #22655
2026-08-24 11:02:04 +02:00
Viktor Szakats
541968e361
circleci: update URL in comment, include in future URL checks
Also:
- mdlinkcheck: check two CI files for broken URLs.

Closes #22654
2026-08-24 10:40:25 +02:00
Viktor Szakats
a1bca29bdd
lib: silence gcc-16 compiler warnings -Wmaybe-uninitialized
Seen in the 'curl-for-win / Windows gcc zlib-classic (x64)' CI job,
after it got an upstream upgrade from gcc-15 to gcc-16:
```
lib/http.c:206:6: error: 'out.str' may be used uninitialized [-Werror=maybe-uninitialized]
  206 |   if(header_has_value(&header, &out)) {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/api.h:188:3: error: 'guard.data' may be used uninitialized [-Werror=maybe-uninitialized]
  188 |   Curl_mapi_enter((g), (m), CURL_MAPI_FN_##fn, (r)) && (m)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/multi.c:1695:6: note: in expansion of macro 'CURL_MAPI_ENTER'
 1695 |   if(CURL_MAPI_ENTER(&guard, m, multi_poll, &mresult)) {
      |      ^~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/32626356576/job/97162205296#step:3:4906

Closes #22651
2026-08-24 09:38:10 +02:00
Daniel Stenberg
be459eb4e3
RELEASE-NOTES: synced 2026-08-23 23:34:48 +02:00
Daniel Stenberg
740d9520a9
docs: mention possible auth option conflicts
Do not mix HTTP auth options with custom Authorization headers.

Closes #22648
2026-08-23 23:26:08 +02:00
Kieran Gannon
a334227e8a
tidy-up: fix typos in docs and comments
Correct grammar and spelling in documentation and source comments. Also
fix the Aspell configuration key and one user-facing OpenSSL error
message.

Closes #22647
2026-08-23 22:27:41 +02:00
Daniel Stenberg
85c8f6f3a5
cookie: allow loading cookies for localhost
The added code to avoid loading PSL cookies from files from PR #22500
(c041895, not shipped in a release), calls psl_is_public_suffix(),
returns TRUE also for "localhost" (!).

We now allow cookies again for localhost. Added test 320 to verify.

Reported-by: Athos Ribeiro
Fixes #22645
Closes #22646
2026-08-23 22:16:47 +02:00
zaveshaa
8770c49de4
docs: remove doubled word in SECURITY-ADVISORY.md
Closes #22642
2026-08-23 17:38:16 +02:00
zaveshaa
5c61e16869
docs: make 5 example snippets compile cleanly with clang
verify-examples.pl invokes 'gcc', which on macOS is clang. With
-Wall -Wextra... -Werror -pedantic, clang rejects two patterns that
GNU gcc accepts:

- passing a char * to %p without a cast (-Wformat-pedantic): the C
  standard says %p expects void *, so cast explicitly in the
  CURLOPT_PROGRESSDATA, CURLOPT_PROGRESSFUNCTION, CURLOPT_XFERINFODATA
  and CURLOPT_XFERINFOFUNCTION examples

- returning CURLcode result from main() when curl_easy_init() returned
  NULL leaves it uninitialized (-Wsometimes-uninitialized) in the
  CURLINFO_TLS_SSL_PTR example: initialize it to CURLE_OK like other
  man pages already do

Closes #22638
2026-08-22 16:18:50 +02:00
renovate[bot]
1086f513b8
GHA: update dependency pizlonator/fil-c to v0.684
Closes #22637
2026-08-22 08:05:21 +02:00
Daniel Stenberg
6c04b424bd
VERSIONS.md: document Rock-solid curl releases
While they are not curl releases done by the Open Source project or
provided openly, these version numbers might appear in the wild so let's
document them in this separate list.

Closes #22636
2026-08-22 00:32:01 +02:00
Stefan Eissing
7e7ee16dd3
ws: fix write callback error handling
When websocket writes out data thought the registered write callback and
that returns an error, clear the write buffers, so a sub-sequent flush
will not attempt another write. The transfer is failed at that point and
should no longer invoke the callback.

Fixes #22627
Reported-by: Scott Talbert
Closes #22634
2026-08-21 23:01:23 +02:00
Viktor Szakats
5d6dc81678
GHA/checksrc: preprocess workflows to lint more shell code
`zizmor` keeps being confused by non-"well-known" shell designators
`msys2 {0}`, `<path>\bash.exe '{0}'`, `cpa.sh {0}`, while `actionlint`
silently skips checking such shell code. Though it's all POSIX/bash.
Replace the unrecognized shell designators with `bash` before running
the linters, to remove these blind spots.

zizmor pedantic persona:
Before: `No findings to report. Good job! (1 ignored, 61 suppressed)`
After: `No findings to report. Good job! (1 ignored)`

zizmor auditor persona:
Before: `No findings to report. Good job! (62 ignored)`
After: `No findings to report. Good job! (1 ignored)`

Closes #22626
2026-08-21 11:36:19 +02:00
Stefan Eissing
2f1dda9691
u8_strset: start with 8 default entries
The previous 4 entries were exhausted on simple command lines, depending
on environment/build. Grow the initial size to 8 to avoid early allocs.

Closes #22633
2026-08-21 11:25:04 +02:00
Viktor Szakats
4f8dabcec2
GHA: install MSYS2 Perl manually for latest GitHub runners
As the MSYS2 update propagates into more GitHub runner images, we need
to install Perl to avoid native Windows (aka Strawberry) Perl breaking
jobs that are running tests.

For others jobs, this patch leaves the new default Strawberry Perl. It's
fine to use it a little bit more.

Also:
- libssh 32-bit was dropped upstream, replace with libssh2, and move
  libssh to the 64-bit job running tests.
  f6ae36581d
  https://github.com/msys2/MINGW-packages/pull/30777

Refs:
https://github.com/actions/runner-images/issues/14562
https://github.com/actions/runner-images/pull/14541#issuecomment-5294304716
636489312c
https://github.com/msys2/MSYS2-packages/pull/6491
https://github.com/msys2/MSYS2-packages/pull/6479

Bug: https://github.com/curl/curl/pull/22537#issuecomment-5359154818
Follow-up to d854ab4673 #22580

Closes #22632
2026-08-21 09:45:59 +02:00
Stefan Eissing
c8df3defd9
lib: new easy option string storage
Change the storage of easy handle option strings from an array sized for
all possible options to a hash set to reduce memory footprint.

Give the hash set initially room for 4 strings, with first allocation
happening when it goes beyond that. Measurements without test suite
and a forced fail on growing the set gives:

Size Result
2    1261 tests out of 1951 reported OK: 64%
4    1792 tests out of 1951 reported OK: 91%
8    1944 tests out of 1951 reported OK: 99%
16   1949 tests out of 1951 reported OK: 99%
32   single fail of 3211, unit test for u8_strset

Add u8_strset that keeps the tuples (uint8_t id, char *str)
and allows set/unset by `id`. Add that as data->set.strings.

Define MACROS
* CURL_EASY_STR(data, id) for access
* CURL_EASY_STR_SET(data, id, s) for setting, making a copy
* CURL_EASY_STR_SETN(data, id, s) for setting, no copy
* CURL_EASY_STR_CLEAR(data, id) for unsetting
* CURL_EASY_STR_CLEAR0(data, id) for unsetting and zero-ing value

Add `data->set.str_copypostfields` to handle former `STRING_COPYPOSTFIELDS`
string that was not always a string and could carry NUL bytes.

Add unit tests to test3211.

Closes #22628
2026-08-21 09:36:07 +02:00
Fred Klassen
961c95fea6
openssl: fix DER buffer leak in Apple SecTrust verification
`ossl_chain_get_der()` allocates a DER encoding of each peer certificate
via `i2d_X509()`, but `Curl_vtls_apple_verify()` only copies it into a
CFData and never frees the original. This leaks per certificate, per
handshake, whenever USE_APPLE_SECTRUST is used with the
OpenSSL/LibreSSL/BoringSSL backend.

Fix frees the buffer inside openssl.c itself, so the GnuTLS backend
(which borrows rather than allocates) is unaffected.

Closes #22631
2026-08-21 09:30:36 +02:00
Alhuda Khan
2ba2fe3540
ldap: base64-encode LDIF values beginning with colon or less-than
A value whose first byte is ':' or '<' is not a SAFE-INIT-CHAR per RFC
2849 and must be base64-encoded, but ldap_value_needs_base64() and the
inline check in oldap_recv() only encoded on a control byte or
leading/trailing blank. Such a value was emitted verbatim, producing
LDIF that strict parsers reject.

Closes #22339
2026-08-21 00:16:12 +02:00
Jayanth Vennamreddy
3bc93643cb
docs: connection reuse behavior for socket callbacks
Document observed behavior around connections reuse and socket
callbacks. When CURLOPT_CLOSESOCKETFUNCTION is copied and when it is
invoked.

Closes #20521
2026-08-21 00:12:45 +02:00
Alb3e3
74b732f637
tool_msgs: make notef() respect --silent
Until 8.17.0 the --silent check lived in voutf(), so it covered every
message type that went through it. 56450ce26f moved that check out to
the callers so that errorf() could honour --show-error, and warnf() and
errorf() got the check back, but notef() did not. Since then "Note:"
messages have been printed even with --silent, as long as tracing was
on.

Reported-by: Jace Laquerre
Fixes #22623
Closes #22625
2026-08-20 22:55:04 +02:00
Stefan Eissing
aab0518d04 url: fix handling of empty user in ntml matching
Line should already have been removed in 7103a93, but neither
humans nor clankers caught it. tststs...

Prior to this change it appears all reuse of empty cred connection was
blocked for ntlm instead of the intended behavior of allowing
reuse in the limited circumstance when it is the same connection used by
the transfer before.

Closes https://github.com/curl/curl/pull/22629
2026-08-20 11:35:43 -04:00
Dan Fandrich
f31251b645 test_07_upload: skip tests if nghttpx lacks QUIC
If nghttpx is available but lacks QUIC support, disable the tests that
depend on that support.

Co-authored-by: Stefan Eissing
Fixes #22609
Closes #22624
2026-08-20 07:41:56 -07:00
Daniel Stenberg
9b29495863
http: custom Authorization: header overrides Negotiate
As documented and as it does for other methods.

Difficult to test since it needs a successful kerberos ticket.

Reported-by: sdgh179 on github
Fixes #22610
Closes #22622
2026-08-19 23:39:09 +02:00
Daniel Stenberg
fc6c67ce86
docs: clarify that cookies need domain set to match
Especially important if reading cookies from HTTP headers, which is a
style we discourage.

Reported-by: accl on hackerone
Closes #22621
2026-08-19 22:54:46 +02:00
Daniel Stenberg
695aa15743
urldata: remove the aptr struct
Move the two remaining fields into the state struct instead, within the
HTTP ifdef.

Also: make the AWS sigv4 code always rely on the http_host value. It
was previously conditionally trying to also work if it was not set, but
that logic was not creating an identical copy so it would fail.

Closes #22620
2026-08-19 07:49:55 +02:00
Viktor Szakats
79132a1daf
GHA: use --subset runtests option, run random subset in riscv64 job
Also:
- drop most hand-tuned `--min` options, in favor of defaults.
- enable tests on emulated riscv64.
  Suggested-by: Dan Fandrich
  Ref: https://github.com/curl/curl/pull/22590#issuecomment-5303238102
- drop building examples on emulated riscv64.

Adding around 3.5 minutes to the riscv64 job:
0.5 Perl install, 2 minutes to build tests, 1 minute to run 100 tests.

Follow-up to 66486691ee #22619
Follow-up to e669179681 #22616
Follow-up to 58cb1e2f1f #22618
Follow-up to d00000673d #22602

Closes #22617
2026-08-18 16:07:42 +02:00
Viktor Szakats
66486691ee
runtests: divide minimum required tests by subsets
When the minimum comes from `CURL_TEST_MIN`, to improve the default
behavior. It may still need manual adjustment in cases.

Follow-up to e669179681 #22616
Follow-up to 58cb1e2f1f #22618
Cherry-picked from #22617

Closes #22619
2026-08-18 15:45:16 +02:00
Daniel Stenberg
e669179681
runtests: introduce a subset option
To make it easier to run different subsets of the tests in separate
invokes.

Closes #22616
2026-08-18 13:45:52 +02:00
Viktor Szakats
58cb1e2f1f
runtests: allow resetting CURL_TEST_MIN via --min=0
Set the default to `CURL_TEST_MIN` if set, first. Then process the
command-line options to override it. Previously, the env took over if
the command-line explicitly tried to set it to zero.

Ref: #22617

Follow-up to 3f1cd809ee #19942

Closes #22618
2026-08-18 13:20:46 +02:00
Daniel Stenberg
64ea25cfe6
KNOWN_BUGS: remove old entries and NTLM related
- The ancient Negotiate ones are just outdated
- NTLM is going away, no need to list the bugs anymore

Closes #22615
2026-08-18 12:22:44 +02:00
Viktor Szakats
b8b1dc0a0d
config-win32.h: drop UWP, c-ares, simplify more
UWP requires VS2015+. Project files have no support for c-ares.
Drop redundant guard, merge `#if` blocks.

Follow-up to 1db93bdb7c #22595

Closes #22613
2026-08-18 11:44:14 +02:00
Daniel Stenberg
b729003d83
TODO: remove "Support MQTTS"
implemented

Follow-up to 6c31df453b
2026-08-18 11:18:11 +02:00
Stefan Eissing
1d8f54823e
Happy Eyeballing v3: resolution delay of 25ms
After telemetry data from Mozilla reported the P99 DNS resolution
differences between A and AAAA responses to by 21ms, reduce curl's
resolution delay to 25ms.

What could possibly go wrong?

Closes #22612
2026-08-18 11:05:52 +02:00
Samuel Henrique
38c5ff6bfa
tests: fix Content-Length mismatch in test 2064
Closes #22611
2026-08-18 08:02:08 +02:00
Anton Karpov
05ddf5511a
headers: name the arguments the way the definitions name them
Eleven arguments are named one way in the header and another in the
definition. the compiler only checks types so nothing is broken, but the
header is what people read first, and then the name changes under them
in the source:

```
curl_dbg_malloc          size     ->  wantedsize
curl_dbg_calloc          n, size  ->  wanted_elements, wanted_size
curl_dbg_realloc         size     ->  wantedsize
curl_dbg_strdup          src      ->  source
r_freeaddrinfo           res      ->  cahead
my_get_line              fp, db   ->  input, buf
curl_slist_append_ccsid  l        ->  list
curl_version_info_ccsid  cid      ->  ccsid
curl_easy_setopt_ccsid   curl     ->  easy
```

Follow-up to df6014894b #20794

Closes #22550
2026-08-18 00:11:02 +02:00
Stefan Eissing
406edd036a
filter: change time reporting
Replace the QUERY filter methods for connect and appconnect time with a
new control CF_CTRL_REPORT_STATS that is triggered when a connect ends
(successful or not).

Filters in the connection can then report their statistics. Socket and
TLS filters do this only once. Subsequent CF_CTRL_REPORT_STATS will do
nothing.

This prevents timers to be reported twice in STARTTLS scenarios.

Fixes #22587 (again)
Closes #22596
2026-08-17 23:35:57 +02:00
Viktor Szakats
a01a24deaf
curlx_inet_pton: drop setting errno on error
Follow-up to bb406386d9 #22229

Closes #22607
2026-08-17 19:11:51 +02:00