Commit graph

7637 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Daniel Stenberg
b729003d83
TODO: remove "Support MQTTS"
implemented

Follow-up to 6c31df453b
2026-08-18 11:18:11 +02:00
hunterinvariants
c7c42afab9
file: support directory listing on Windows
Closes #22577
2026-08-15 11:56:25 +02:00
Stefan Eissing
3d6d93a6be
multi: timeout improvements
- Move expire timeout code from multi into splay.c
- keep a "time_base" timestamp to calculate timediff_t for
  actual timeout values. Unfortunately this means our
  timeouts will go wrong after ~500,000 years of continuous
  operations...
- use timediff_t as key in splay instead of curltime
- use timediff_t in transfers expire times instead of curltime
- re-comment splay.c for better understanding how it works
- replace splay nodes double-linked "same" list with a single link,
  we almost never have duplicate keys
- keep transfer `mid` in splay nodes instead of the transfer pointer
- keep registered bit in splay node for tracking instead of separate
  bit in transfer
- adapt unit1309.c to changes in timediff_t and mid

Closes #22584
2026-08-14 22:39:41 +02:00
Viktor Szakats
8a8ff47b63
tidy-up: C and CI
- drop redundant casts for `CURL_UNCONST()` pointers (Windows).
- GHA/linux: delete redundant/dupe `-g` C flag in memory sanitizer job.
  Spotted-by: Daniel Stenberg
- examples/http2-upload: drop local macro.
- examples/http2-upload: drop leading underscore from union name.
- examples/http2-upload: drop interim macro.
- tests/server/util: reapply patch lost in a rebase.
- sync `main()` declarations across the codebase.

Closes #22559
2026-08-12 15:42:54 +02:00
Viktor Szakats
a833c83a87
build: minor debug option message fixes/improvements
- CMAKE_INSTALL.md: sync up option desc with `CMakeLists.txt`.
- sync `--enable-debug` configure text with help description.
- say `--disable-debug` is the default in help description.

Follow-up to a15cf1ea07 #22512

Closes #22532
2026-08-10 18:51:15 +02:00
Viktor Szakats
5ef4e1cabc
checksrc: check for assert, replace in tests where missing, drop from examples
Follow-up to 791b6883ed #22521

Closes #22527
2026-08-10 18:14:14 +02:00
Viktor Szakats
5050196dcc
build: require !NDEBUG for debug-enabled (aka development) builds
To prevent creating a curl-development (aka debug-enabled, aka
`-DENABLE_DEBUG=ON`, `--enable-debug` or `DEBUGBUILD`) build without
`assert()`s. Since it may break expectations by missing to catch error
cases. Also to make it less likely to build an inherently insecure
development build by accident.

- in CMake, for non-Multi-Config builds, show this error unless Debug
  configuration is set at configure-time:
  ```
  CMake Error at CMakeLists.txt:263 (message):
    Debug-enabled (aka development mode) curl requires the Debug configuration
  ```
  Ref: https://github.com/curl/curl/actions/runs/31159065911/job/92805128331?pr=22513#step:6:56
  The other 3 predefined configs (`Release`, `RelWithDebInfo`,
  `MinSizeRel`) set `NDEBUG` automatically.

- or this message in other cases, e.g. when using CMake Multi-Config
  with non-Debug, e.g. `--config Release`, or passed `NDEBUG` manually
  with either build tools:
  ```
  curl_setup.h(1062): fatal error C1189: #error:
    "Debug-enabled builds cannot be combined with NDEBUG"
  ```
  Ref: https://github.com/curl/curl/actions/runs/31159628749/job/92807878479#step:9:28

Also:
- INSTALL-CMAKE.md: document.
- GHA/windows: adjust CI jobs to meet the above requirement, where
  missing.

Reported-by Stefan Eissing
Bug: https://github.com/curl/curl/pull/22484#discussion_r3730045572
Ref: ea98445680 #13592
Fixes #22481
Fixes #22484

Closes #22513
2026-08-10 18:14:09 +02:00
Stefan Eissing
2d30fd26a0
DoH: improvements
- decode results when individual requests are done
- makes happy eyeballing start asap
- remove doh_resp structures as no longer needed
- remove CURL_DNS_TYPE_NS, CURL_DNS_TYPE_CNAME and
  CURL_DNS_TYPE_DNAME from DoH
- DoH: do not set PIPEWAIT and SSL OPTS when url starts with http:
- mark Doh master handle as dirty after every sub-request, not only the last
- Doh: start probe on AAAA before A (was the other way).

cf-dns: set EXPIRE_HAPPY_EYEBALLS timer when waiting 50ms on AAAA
result or progress will not be triggered in time.

Add debug env var CURL_DBG_HE_AAAA_AWAIT_MS to override the
default 50ms on waiting for the AAAA result to arrive.

test2100: set CURL_DBG_HE_AAAA_AWAIT_MS to 60 seconds to
provide enough time for slow CI runs to sent all DoH requests.

closes #22514
2026-08-10 13:53:31 +02:00
Jay Satiro
a15cf1ea07 configure: clarify --enable-debug option
- Change --enable-debug help text to say it is for developing curl.

- Warn when --enable-debug is used.

This change copies the help text and warning from cmake ENABLE_DEBUG.
Also, it shortens the "for debugging curl itself" to just say "for
debugging curl".

Now it looks like this:

  --enable-debug          Enable curl debug features (for developing
                          curl)
  --disable-debug         Disable curl debug features

Ref: https://github.com/curl/curl/issues/22481#issuecomment-5207220359

Reported-by: Viktor Szakats

Closes https://github.com/curl/curl/pull/22512
2026-08-07 11:59:26 -04:00
Daniel Stenberg
2a5d6a5502
curl_url_set.md: expand the CURLU_NO_AUTHORITY description
Closes #22515
2026-08-07 13:06:57 +02:00
Daniel Stenberg
c04189523c
cookie: refuse to load cookies set against a PSL domain
Verified by test 409

Reported-by: 1rhino2 on hackerone

Closes #22500
2026-08-06 17:03:02 +02:00
Daniel Stenberg
de9919f38a
TODO: ECH for QUIC
And drop:

- Consider OCSP stapling by default

It is a practice that is going out-of-style, so doing this by default now
seems wrong.

- Provide callback for cert verification

We have lots of options already. Let's not do this.

Closes #22504
2026-08-06 14:55:34 +02:00
Daniel Stenberg
6e96c468d4
DEPRECATE.md: HTTP/2 Server Push gets removed in March 2027
URL: https://curl.se/mail/lib-2026-08/0003.html
Closes #22490
2026-08-06 11:14:31 +02:00
Daniel Stenberg
2112f185c0
TODO: do not consider APPDATA for netrc
See #22462
Closes #22480
2026-08-04 11:48:01 +02:00
Viktor Szakats
a368fbe968
curl_ed25519: add GnuTLS support (via nettle, hogweed)
The necessary cryptography API is provided by nettle 3.1+, via its
'hogweed' library. The minimum GnuTLS version required by curl is 3.6.5,
which requires nettle 3.4.1+, so the API is always available.

Also:
- autotools: detect and use nettle's hogweed library.
- cmake/FindNettle: add support for the hogweed library.
- GHA/http3-linux: enable in the autotools/cmake GnuTLS jobs.

Ref: 4353ea025a

Closes #22456
2026-08-03 16:48:08 +02:00
Viktor Szakats
0043b3fb8c
DEPENDENCIES.md: document minimum nettle version: 3.4.1 (2018-12-04)
It comes as a transitive requirement by the minimum GnuTLS version.
Because libcurl uses nettle directly (in GnuTLS builds), I figure it is
useful to document explicitly.

Refs:
4353ea025a
https://github.com/curl/curl/pull/22456#discussion_r3695417678
https://github.com/gnutls/nettle/releases/tag/nettle_3.4.1_release_20181204

Closes #22457
2026-08-02 10:30:59 +02:00
Daniel Stenberg
5eb2f0757e
curl: help category cleanups
- add 'mqtt' as a category
- add more protocol categories to several options
- make --data worded better to also cover MQTT

Closes #22447
2026-07-30 16:17:55 +02:00
Viktor Szakats
1d7b8e6c29
gitignore: maintenance updates
- docs/cmdline-opts/.gitignore: also ignore `manpage.tmp.*`.
  Follow-up to a55731050e #22386 #21239

- ./.gitignore: drop obsolete entries.
  Follow-up to 4f38db1d28 #1923

Closes #22445
2026-07-30 12:00:22 +02:00
Viktor Szakats
c4013cdb85
tidy-up: comments, messages, formatting
- 'null-terminate', sync casing.
- add an `#endif` comment.
- avoid a few instances of 'will'.
- configure: 'aws' -> 'aws-sigv4', where missing.
- unfold/fold lines.
- update memzero/strzero comments.
- uppercase 'CRLF'.

Closes #22443
2026-07-30 11:26:22 +02:00
Daniel Stenberg
172c16b58c
docs/INTERNALS.md -> docs/DEPENDENCIES.md
With some minor cleanups

Closes #22430
2026-07-29 14:20:36 +02:00
Daniel Stenberg
f76f79696e
EXPERIMENTAL: cleanups, unify on titles, merge quiche into a single segment
Closes #22428
2026-07-29 13:37:13 +02:00
Daniel Stenberg
ef15676abb
EXPERIMENTAL: Apple fast UDP
Follow-up to 079a11bcba

Closes #22428
2026-07-29 13:37:13 +02:00
Viktor Szakats
079a11bcba
vquic: add option to use Apple fast UDP
Using Apple's secret `SYS_recvmsg_x` and `SYS_sendmsg_x` syscalls for
receiving/sending batches of UDP packets.

Since it uses undocumented calls, it's experimental and disabled by
default.

To enable:
- autotools: `--enable-apple-fast-udp`
- cmake: `-DCURL_ENABLE_APPLE_FAST_UDP=ON`

Also:
- enable in two H3 CI jobs with both build tools, pytest and clang-tidy.

Refs:
https://max-inden.de/post/fast-udp-io-in-firefox/
https://www.macsyscalls.com/en/syscall/480-recvmsg-x
https://www.macsyscalls.com/en/syscall/481-sendmsg-x

C-code-authored-by: Stefan Eissing
Build-code-authored-by: Viktor Szakats

Closes #22341
Closes #22417
2026-07-29 11:53:19 +02:00
Daniel Stenberg
14cd071484
HISTORY: add when c-ares support was introduced (2004) 2026-07-29 09:05:04 +02:00
Daniel Stenberg
cccd76f2aa
docs/INTERNALS.md: move a column one byte
To make the minimum gap two spaces, so that we can separate the columns
programmatically
2026-07-28 22:48:20 +02:00
Dan Fandrich
3de2777421 tests: target Python 3.8 as the minimum Python version
This version is already two releases out of support, but is "only" 7
years old so is probably still being used in the real world. Document
this version along with some other testing dependencies.  Remove code
support for earlier versions. Disable ruff checks that need a newer
version.
2026-07-28 08:52:01 -07:00
Viktor Szakats
e1450d8fda
tidy-up: use more static, sizeof(), char[], double-const
- make `const` data `static`, where missing and possible.
- replace `strlen()` on literal or const strings with `sizeof()`.
  While the latter is optimized by popular C compiler, e.g. MSVC only
  does it with `/O2`.
- replace magic numbers with `sizeof()`, where missing.
- introduce `CURL_CSTRLEN()` macro for `sizeof(char[]) - 1`.
- use `CURL_CSTRLEN()` macro.
- move `const` before integer types, where missing.
- replace `char *var` with `var[]`, where missing and possible.
- use double const, where missing.
  `static const char *` -> `static const char * const`.
- lib1514: constify pointers.
- unit3205: drop redundant cast, avoid another one.
- unit1666: map `OID()` macro to identical `STRCONST()`.

Closes #22406
2026-07-28 13:53:11 +02:00
Daniel Stenberg
573a6ec16b
urlapi: improved return codes
- add CURLUE_BACKSLASH that can be returned when a backslash was used
  where a forward one probably was intended.

- make CURLUE_NO_HOST higher priority than port number errors for URLs
  without hostname. Like in "http://::1"

- shortened some URL parser error strings

Extend test 1560 to verify.

Reported-by: kit-ty-kate on github
Fixes #22337
Closes #22408
2026-07-28 13:37:28 +02:00
Daniel Stenberg
27a4557c9e
EXPERIMENTAL.md: We do not accept vuln reports for experimental features
Closes #22411
2026-07-28 09:20:28 +02:00
Matthew John Cheetham
a8881e5e1d spnego: block NTLM fallback in SPNEGO negotiation
- Switch the Windows SSPI identity struct to SEC_WINNT_AUTH_IDENTITY_EX
  to use !ntlm in PackageList to prevent NTLM from being offered.

- For GSS filter out NTLMSSP OID, and restrict via gss_set_neg_mechs()
  to prevent NTLM from being offered.

- Extend the GSS-API debug stub layer to support the NTLM blocking logic
  without a real Kerberos environment.

- Update test 2057 to check that negotiate auth is silently skipped with
  no Authorization header when only NTLM stub credentials are available.

- Add SPNEGO NTLM blocking test 2093 which verifies that Kerberos
  credentials still succeed when NTLM is blocked within SPNEGO.

- Suppress tests valgrind leak for MIT krb5 gss_display_status, since
  the leak is in the library and not in curl.

To suppress the tests valgrind leak, the wildcard '...' bridges over an
anonymous frame inside libgssapi_krb5.so that valgrind reports as '???'.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Aided-by: Johannes Schindelin

Closes https://github.com/curl/curl/pull/21315
Closes https://github.com/curl/curl/pull/22410
2026-07-27 17:28:52 -04:00
Viktor Szakats
7484874fdf
cmake: verify if options are listed in INSTALL-CMAKE.md
Also:
- add one debug option to pass the test.

Ref: https://github.com/curl/curl/discussions/14885#discussioncomment-10632311

Closes #22404
2026-07-27 10:16:43 +02:00
Viktor Szakats
12532713d6
build: tidy up httpsig options
- say 'experimental'.
- cmake: add to documentation.
- cmake: alpha-sort.

Follow-up to a55731050e #22386

Closes #22391
2026-07-26 16:43:18 +02:00
Daniel Stenberg
9bcc64c39b
curl: make --httpsig-key take a key OR a file name for key
Verified by test 5022

Closes #22392
2026-07-25 22:10:30 +02:00
Sameeh Jubran
a55731050e
httpsig: add RFC 9421 HTTP Message Signatures support
Add support for signing outgoing HTTP requests per RFC 9421 using
Ed25519 or HMAC-SHA256 algorithms.

New libcurl options:
 - CURLOPT_HTTPSIG: signing algorithm ("ed25519" or "hmac-sha256")
 - CURLOPT_HTTPSIG_KEY: path to hex-encoded key file
 - CURLOPT_HTTPSIG_KEYID: key identifier for Signature-Input
 - CURLOPT_HTTPSIG_HEADERS: space-separated components to sign

New CLI flags: --httpsig, --httpsig-key, --httpsig-keyid,
--httpsig-headers

The crypto layer follows the sha256.c multi-backend pattern with
implementations for OpenSSL (EVP_DigestSign) and wolfSSL
(wc_ed25519_sign_msg). HMAC-SHA256 uses the existing Curl_hmacit()
infrastructure which works on all backends.

Verified by test 5000 to 5021

Assisted-by: Daniel Stenberg
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
Closes #22386
Closes #21239
2026-07-25 16:25:37 +02:00
Stefan Eissing
a954d87f0b
httpsrr: DoH with HTTPS, fix response handling
Fix handling of DoH response that only asks for HTTPS records.

Add test 2117 for checking that a HTTPS-RR resolve is processed,
even though the actual answer is invalid.

Closes #22372
2026-07-24 22:58:51 +02:00
Viktor Szakats
8734b08883
tidy-up: miscellaneous
- CMake/CurlTests.c: sync indent with rest of file and most of code.
- cmake: sync term in `_CURL_PREFILL` description with rest of code.
- curl_setup.h: document function relying on `_CRT_SECURE_NO_WARNINGS`.
- tests/http/scorecard.py: typo in message.
- 'Quiche' -> 'quiche'.
- fix comment and formatting nits.

Closes #22378
2026-07-23 14:19:23 +02:00
Viktor Szakats
0ada20387c
tidy-up: fix Perl syntax and formatting nits
Closes #22376
2026-07-23 12:56:18 +02:00
Viktor Szakats
3a0c600a1e
tidy-up: fix comment indentation
Closes #22373
2026-07-23 12:01:40 +02:00
Viktor Szakats
6bff85be68
tool_xattr: add support for Windows alternate data stream
Requires a supported filesystem, i.e. NTFS.

Example:
```console
> curl.exe https://curl.se/index.html --output test.txt --xattr --referer https://curl.se/
> cat < test.txt:Zone.Identifier

[ZoneTransfer]
HostUrl=https://curl.se/index.html
ReferrerUrl=https://curl.se/
```

Where newlines are CLRF, `ReferrerUrl` is set when using `--referer`
option.

Also:
- test688: make it test `--referer`.
- document `user.xdg.referrer.url` in `--xattr` man page.

Refs:
https://en.wikipedia.org/wiki/Mark_of_the_Web
https://en.wikipedia.org/wiki/NTFS#Alternate_data_stream_(ADS)
https://learn.microsoft.com/en-us/windows/win32/fileio/file-streams
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/c54dec26-1551-4d3a-a0ea-4fa40f848eb3

Ref: #22345

Closes #22354
2026-07-22 12:27:39 +02:00
11soda11
057b251358
tool_doswin: add stdin relay auth
Verify the peer with a random number in the background thread.

Closes #21467
2026-07-22 00:45:12 +02:00