Commit Graph

35972 Commits

Author SHA1 Message Date
Viktor Szakats
1e430f806a
configure: tidy up internal names in ngtcp2 ossl detection logic
Replace "quictls" with "ossl".

Follow-up to 5eefdd71a3 #17027
Cherry-picked from #18377
Closes #18378
2025-08-23 12:42:05 +02:00
Viktor Szakats
4f0e530c77
tidy-up: formatting
Closes #18373
2025-08-23 01:12:27 +02:00
Viktor Szakats
03868ca714
asyn-thrdd: fix no HAVE_GETADDRINFO builds
mingw32ce, CM 4.4.0-arm schannel:
```
lib/asyn-thrdd.c: In function 'gethostbyname_thread':
lib/asyn-thrdd.c:349: error: too many arguments to function 'async_thrd_cleanup'
```
Ref: https://github.com/curl/curl/actions/runs/17158865566/job/48682687295?pr=18039#step:9:21

Follow-up to 88fc6c491f #18263
Closes #18371
2025-08-23 00:16:06 +02:00
Viktor Szakats
d6c51a8fda
cmake: CURL_CA_FALLBACK only works with OpenSSL
Ref: 2f6524ce3c #18364
Ref: #18362

Closes #18365
2025-08-23 00:02:33 +02:00
Daniel Stenberg
6d53263f0b
TODO: remove the expand ~ idea
As we can expand evironment variables now, HOME can easily be used
instead.

Ref: #18240
Closes #18363
2025-08-22 23:55:51 +02:00
Daniel Stenberg
2f6524ce3c
acinclude: --with-ca-fallback only works with OpenSSL
Make it error if another TLS backend is used. Also tweaked the
documentation for it to make it more clear it is only for OpenSSL.

Follow-up to 9cf4759354

Reported-by: Michael Osipov
Fixes #18362
Closes #18364
2025-08-22 23:54:14 +02:00
Viktor Szakats
806d97d172
openssl: merge two #if blocks
Cherry-picked from #18330
Closes #18370
2025-08-22 22:52:51 +02:00
Viktor Szakats
b54039de2c
openssl: use RSA_flags() again with BoringSSL
Supported since 2017-12-18:
a0c87adbf0

Follow-up to cd276c3cca #2117

Closes #18369
2025-08-22 20:36:11 +02:00
Viktor Szakats
78f53e0460
openssl: enable HAVE_KEYLOG_CALLBACK for AWS-LC
Supported by all AWS-LC versions:
6e3f5cc7e1

Closes #18368
2025-08-22 20:36:10 +02:00
Viktor Szakats
63bf7a0898
openssl: drop redundant HAVE_OPENSSL_VERSION macro
It served as an extra guard over `OPENSSL_VERSION_STRING`.

Also, document that `OPENSSL_VERSION_STRING` is supported by OpenSSL 3+.

Closes #18367
2025-08-22 18:55:26 +02:00
Viktor Szakats
0be7f382dc
openssl: add and use HAVE_BORINGSSL_LIKE internal macro
To cover the common case of guarding for both BoringSSL and AWS-LC.

Cherry-picked from #18330
Closes #18358
2025-08-22 17:49:21 +02:00
Viktor Szakats
8c29a29add
openssl: add and use HAVE_OPENSSL3 internal macro
Cherry-picked from #18330
Closes #18360
2025-08-22 17:21:29 +02:00
Viktor Szakats
db08e86cfb
openssl: drop more legacy cruft
- drop `ALLOW_RENEG` undocumented (insecure) build-time option.
- drop unnecessary check for `OPENSSL_VERSION_NUMBER`.
  It's present in all supported OpenSSL versions and forks.

Follow-up to 80c10c5d5d #18351
Follow-up to 59311bd3df #3293 #3283

Closes #18359
2025-08-22 17:21:28 +02:00
Daniel Stenberg
bfbee798ca
tool_operate: use stricter curl_multi_setopt() arguments
To please the curl_multi_setopt() typechecker

- set multi callback protypes to match exactylu
- set CURLMOPT_MAX_HOST_CONNECTIONS as a long

Closes #18357
2025-08-22 17:13:07 +02:00
Daniel Stenberg
844c385812
typecheck-gcc: add type checks for curl_multi_setopt()
Test 745 verifies that all options are tested.

Closes #18357
2025-08-22 17:12:58 +02:00
Daniel Stenberg
b3570b36d7
runtests: show still running tests when nothing has happened for a while
... even if there are tests still pending. To help visualize tests that
might be hanging.

Attempts to set the limit at 10 seconds of silence.

Closes #18349
2025-08-22 16:28:03 +02:00
Stefan Eissing
a8d20cd223
asyn-thrdd: manage DEFERRED and locks better
- cancel thread waits until thread start is at least 5ms in the past
  to give it some time to get its cancellation setup in place
- cancel thread without holding the mutex. It's supposed to be an
  async operation, but better be safe
- set DEFERRED cancel state explicitly, should be default in a pthread,
  but better be safe

Closes #18350
2025-08-22 16:26:11 +02:00
Daniel Stenberg
f5ee566dbc
top-complexity: maximum accepted set to 72
Down from 80. Show all functions above 60.

Closes #18354
2025-08-22 16:22:36 +02:00
Daniel Stenberg
33572b851e
tool_urlglob: handle a zero length glob piece
Follow-up to 034612cd51

Add test 759 to verify

Reported-by: Stanislav Osipov
Fixes #18352
Closes #18353
2025-08-22 16:22:07 +02:00
Viktor Szakats
80c10c5d5d
openssl: remove legacy cruft, document macro guards
- assume:
  - `BIO_CTRL_EOF`
  - `SSL_CTRL_SET_MSG_CALLBACK`
  - `SSL_CTRL_SET_MSG_CALLBACK`
  - `SSL_CTRL_SET_TLSEXT_HOSTNAME`
  - `SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER`
  - `SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS`
  - `SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG`
  - `SSL_OP_NO_COMPRESSION`
  - `SSL_OP_NO_TICKET`
  - `X509_V_FLAG_PARTIAL_CHAIN`
  - `X509_V_FLAG_TRUSTED_FIRST`
  They are present in all supported OpenSSL (and fork) versions.

- replace `SSL_ERROR_WANT_EARLY` with `SSL_ERROR_WANT_CLIENT_HELLO_CB`.
  The former appeared in OpenSSL 1.1.1-dev, but renamed before
  the stable release.

- document support for macros:
  - `ENGINE_CTRL_GET_CMD_FROM_NAME`
  - `SSL_ERROR_WANT_ASYNC_JOB`
  - `SSL_ERROR_WANT_ASYNC`
  - `SSL2_VERSION_MAJOR`
  - `TLS1_3_VERSION`

- drop legacy fallback for `CONF_MFLAGS_DEFAULT_SECTION`.
  It was there for OpenSSL 0.9.8 support.

- fix `SSL_CTRL_SET_MSG_CALLBACK` accidentally serving as a guard for
  OpenSSL (and forks) as a whole.

Tested OK with OpenSSL 1.0.2 and 1.1.0 in CI.

Closes #18351
2025-08-22 15:53:45 +02:00
Viktor Szakats
3298a43133
spelling: file system
Closes #18348
2025-08-22 15:53:41 +02:00
Viktor Szakats
a9705e9cfb
examples: make CURLPIPE_MULTIPLEX fallback long
Closes #18356
2025-08-22 14:16:45 +02:00
Viktor Szakats
f6c2907172
test1557: pass long type to multi_setopt()
A wrong type here has seen to manifest in CI failures with gcc-12 macOS.

Ref: https://github.com/curl/curl/pull/18348#issuecomment-3213881790
Ref: https://github.com/curl/curl/actions/runs/17153761944/job/48665734013?pr=18349

Follow-up to b63cce7fee #18339
Follow-up to 88fc6c491f #18263

Closes #18355
2025-08-22 14:16:45 +02:00
Stefan Eissing
cbd5d2507a
asyn-thrdd: fix --disable-socketpair builds
Regression from #18339

Reported-by: Marcel Raad
Closes #18347
2025-08-22 10:36:43 +02:00
Stefan Eissing
6b111f0a8c
ares: use ares_strerror() to retrieve error messages
Add optional detail to `Curl_resolver_error()` to add to failure message
where available. This makes, for c-ares, the reason for a failed
resource available to the user without extra trace config.

When "dns" tracing enabled, print the c-ares server config at the start
of a resolve.

Closes #18251
2025-08-22 10:01:58 +02:00
Stefan Eissing
8ebea37eb1
asyn-thrdd: remove condition variable
Add a flag `thrd_don` to assess if the resolving thread has finished and
only destroy the context when *both* ref_count reaches 0 and thrd_done
is true.

Closes #18345
2025-08-22 09:05:56 +02:00
Daniel Stenberg
c83fa990bd
Revert "asyn-thrdd: use condition var more carefully"
This reverts commit bd4622bfaf.

Not intended for merge!
2025-08-22 09:05:19 +02:00
Stefan Eissing
bd4622bfaf
asyn-thrdd: use condition var more carefully
When the thread started is too fast, the signal will come before the
wait. Add an additional check before the wait to catch the thread
having started or already ended.

Closes #18344
2025-08-22 08:40:40 +02:00
Jay Satiro
b6a5f67259 schannel: improve handshake procedure
- During handshake, do not require reading more data if unprocessed
  encrypted data that may be a complete TLS record is already available.

- During handshake, check that the socket is writeable before processing
  encrypted data that may require an immediate reply to the server.

These two fixes are for issues that were found during renegotiation
testing but could affect any handshake.

Prior to this change it was possible in some abnormal network conditions
for the Schannel TLS handshake procedure to erroneously wait or error.

Ref: https://github.com/curl/curl/pull/18125

Closes https://github.com/curl/curl/pull/18323
2025-08-22 01:50:28 -04:00
Viktor Szakats
7d5f535ca7
appveyor: drop testing with OpenSSL 1.1.0
Replace with 1.1.1.

Follow-up to 12a10ca77c #18337
Cherry-picked from #18330
Closes #18341
2025-08-21 18:30:40 +02:00
Viktor Szakats
7956a2a756
gnutls: fix building with older supported GnuTLS versions
Also:
- GHA/linux-old: switch jobs from OpenSSL 1.0.2 to GnuTLS 3.5.8.

Ref: https://gitlab.com/gnutls/gnutls/blob/master/NEWS
Follow-up to fa0ccd9f1f #15774
Follow-up to 68bd759c2b #15667
Cherry-picked from #18330
Closes #18335
2025-08-21 18:04:25 +02:00
Viktor Szakats
12a10ca77c
appveyor: drop testing with OpenSSL 1.0.2
Cherry-picked from #18330
Closes #18337
2025-08-21 17:04:29 +02:00
Stefan Eissing
b63cce7fee
asyn-thrdd: addressing stalls in ci
Disable pthread_cancel in pushed cleanup function. Close wakeup socket
when shutting down resolving, since we no longer want wakeups.

Closes #18339
2025-08-21 17:00:45 +02:00
Viktor Szakats
0630e66cb4
GHA/non-native: drop MS-DOS jobs, requires OpenSSL 1.0.2
Cherry-picked from #18330
Closes #18338
2025-08-21 16:58:55 +02:00
Viktor Szakats
b3167ef841
appveyor: test openssl with clang-cl
Cherry-picked from #18330
Closes #18334
2025-08-21 13:11:32 +02:00
Viktor Szakats
1d7fddde42
openssl: drop redundant version check
It had a typo, but it wasn't causing an issue, because `TLS1_3_VERSION`
is enough to detect this feature and the version check remained unused.

Follow-up to 0d3b5937b3 #16477
Cherry-picked from #18330
Closes #18333
2025-08-21 13:11:32 +02:00
Viktor Szakats
696150b752
runtests: replace --ci with --buidinfo, show OS/Perl version again
I figure OS/Perl version may be useful to see in local runs,
and also in CI runs where `--ci` was not set:
https://curl.se/dev/log.cgi?id=20250820041228-707387#prob1

Also, only show a message if the `diff` tool is missing.

Follow-up to 985f39c0ce #18147
Closes #18329
2025-08-21 13:11:32 +02:00
Viktor Szakats
8f9d73bcaf
tests: drop unused BLANK envs, unset CURL_NOT_SET
Closes #18328
2025-08-21 13:11:32 +02:00
Viktor Szakats
8fac255fc1
test: add cygwin feature and use it (test 1056, 1517)
To replace custom checks with the same effect.

Closes #18327
2025-08-21 13:11:32 +02:00
Viktor Szakats
29608d694e
GHA/http3-linux: test non-unity, and more cmake
Reshuffle HTTP/3 jobs to:
- test all backends with cmake too. Adding 4 jobs.
- build all backends in non-unity mode too.
  Either with autotools or cmake.
- run tests once for each backend
  Either with autotools or cmake, with a preference for cmake to finish
  faster.
- drop building examples. There is nothing HTTP/3-specific in examples,
  and they are already built in GHA/linux.
- de-dupe some shared settings.

Ref: https://github.com/curl/curl/issues/17857#issuecomment-3047999309
Ref: 8cef6b5e6e #18321 #18320
Ref: d79269166e #18211 #18212
Ref: 454395ba1e #17857 #17864
Ref: b270fec68d #17857 #17858

Closes #18325
2025-08-21 13:11:31 +02:00
Stefan Eissing
8515424df4
websocket example: cast print values to unsigned int
To have not compiler warnings on format checks.

Reported By: Gisle Vanem
Closes #18326
2025-08-21 09:29:59 +02:00
Stefan Eissing
88fc6c491f
threaded-resolver: fix shutdown
Changed strategy to start up and terminate resolver thread.

When starting up:

Start the thread with mutex acquired, wait for signal from thread that
it started and has incremented the ref counter. Thread set
pthread_cancel() to disabled before that and only enables cancelling
during resolving itself. This assure that the ref counter is correct and
the unlinking of the resolve context always happens.

When shutting down resolving:

If ref counting shows thread has finished, join it, free everything. If
thread has not finished, try pthread_cancel() (non Windows), but keep
the thread handle around.

When destroying resolving:

Shutdown first, then, if the thread is still there and 'quick_exit' is
not set, join it and free everything. This might occur a delay if
getaddrinfo() hangs and cannot be interrupted by pthread_cancel().

Destroying resolving happens when another resolve is started on an
easy handle or when the easy handle is closed.

Add test795 to check that connect timeout triggers correctly
when resolving is delayed. Add debug env var `CURL_DNS_DELAY_MS`
to simulate delays in resolving.

Fix test1557 to set `quick_exit` and use `xxx.invalid` as domain
instead of `nothing` that was leading to hangers in CI.

Closes #18263
2025-08-21 09:26:49 +02:00
Daniel Stenberg
f3488ee3a3
RELEASE-NOTES: synced 2025-08-21 09:10:41 +02:00
Gabriel Marin
9a37dd3494
easy: add 'poll_fds' function to reduce size of 'wait_or_timeout'
Closes #18313
2025-08-20 22:55:45 +02:00
Viktor Szakats
2b2d8b7756
tests: delete unused commands
`runtests.pl` defaults to `-` if a command is not set, since
c43ad0f972.

Also:
- drop a stray `</file>`.
- replace a `nothing` with a guaranteed invalid hostname.
  Ref: 4334033b43
- replace unused URLs with `-`.

Closes #18319
2025-08-20 15:31:22 +02:00
Karthik Das
8cef6b5e6e
vquic: add header for native-QUIC OpenSSL, non-unity builds
Follow-up to 7dafe10db2 #18196
Fixes #18320
Closes #18321
2025-08-20 11:31:04 +02:00
Daniel Stenberg
27e61f9767
vquic: change some curl_ prefixes
curl_ and Curl_ are reserved prefixes with special meaning so avoid
using them for file private symbols.

Follow-up to 7dafe10
Closes #18324
2025-08-20 11:01:21 +02:00
Daniel Stenberg
74432bbe6e
bufq: removed "Useless Assignment"
Pointed out by CodeSonar. Made a comment instead.

Closes #18322
2025-08-20 09:05:57 +02:00
Stefan Eissing
faa2db202b
ares: handle channel being destroyed early
We are destroying the ares channel already when we shutdown
resolving. Querying the pollset afterwards is still happening,
especially in event based processing and needs to work in the
absence of a channel.

Fixes #18317
Reported-by: Natris on github
Closes #18318
2025-08-19 17:43:33 +02:00
Viktor Szakats
52775a7fb4
GHA/windows: install Win32::Process* perl modules
To make the CI jobs use native Win32 API calls instead of calling
external tools to look up and kill PIDs of native Windows test server
processes.

Follow-up to 2388b0e587 #18308
Closes #18296
2025-08-19 10:07:25 +02:00