Commit Graph

33002 Commits

Author SHA1 Message Date
Jan Venekamp
ff94698d31
wolfssl: fix setting tls version
The value CURL_SSLVERSION_TLSv1_0 was unsupported.

Closes #14587
2024-08-19 10:50:31 +02:00
Jan Venekamp
38fa458e51
rustls: fix setting tls version
The value CURL_SSLVERSION_TLSv1_0 was unsupported.

Closes #14586
2024-08-19 10:48:05 +02:00
Jan Venekamp
7a7c7a8995
bearssl: fix setting tls version
Previously version_max was ignored.

Closes #14585
2024-08-19 10:46:58 +02:00
Daniel Stenberg
73f62acaa2
RELEASE-NOTES: synced 2024-08-18 22:57:37 +02:00
Viktor Szakats
dcf5a5383c
cmake: fix cmakelint warnings
- keep line lengths below 132 characters.
- fix two "weird indentation" warnings.

Reported-by: Dan Fandrich
Bug: #14580

Closes #14583
2024-08-18 22:53:09 +02:00
Viktor Szakats
3e60f174ee
cmake: tidy up more in Find modules
- add `NAMES` where missing.
- document input variables (including deprecated ones.)
- comment cleanups.
- FindWolfSSL: drop stray `QUIET` from `pkg_check_modules()`.
  (`QUIET` may be re-added for all modules in the future.)

Closes #14579
2024-08-18 22:53:09 +02:00
Viktor Szakats
c57d3aeb55
appveyor: drop uploading artifacts
Uploading artifacts sometimes results in this error:
```
Uploading artifacts...
[1/1] _bld\src\curl.exe (2,022,912 bytes)...100%
Error uploading artifact to the storage: Remote server returned 503: Service Temporarily Unavailable
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/50424126/job/e4envval6xkicv1i#L123

The artifacts are also probably not useful to upload for every run. Also
note that they were missing external DLL dependencies.

Leave the logic there commented, to make it easy to enable as needed for
debugging or testing artifacts locally.

Closes #14581
2024-08-18 12:22:53 +02:00
Viktor Szakats
1d29246534
cmake: tidy up around ngtcp2 and wolfSSL
- fix to add the `m` library without path.
  Follow-up to 8577f4ca08 #14343
  Authored-by: Tal Regev
  Fixes #14549

- move `m` library detection to wolfSSL Find module.
  `m` is necessary for wolfSSL (wolfcrypt) library functions called by
  `libngtcp2_crypto_wolfssl`.
  Follow-up to 8577f4ca08 #14343

- fix comment header about supported `COMPONENT` names.

- quote strings.

- lowercase local variables.

Closes #14576
2024-08-18 11:17:20 +02:00
Viktor Szakats
24889acbfb
cmake: do not unset the deprecated mixed-case variables
To avoid interference with the calling env.

(Keep unsetting for the DIRS/DIR cases in BearSSL and mbedTLS, because
the deprecated variables play a new role in the detection.)

Follow-up to 9fbda4ca75 #14574
2024-08-17 22:50:16 +02:00
Viktor Szakats
9fbda4ca75
cmake: rename wolfSSL and zstd config variables to uppercase
To match with other config variables and other projects.

Rename these CMake configuration variables:
- `WolfSSL_INCLUDE_DIR` -> `WOLFSSL_INCLUDE_DIR`
- `WolfSSL_LIBRARY`     -> `WOLFSSL_LIBRARY`
- `Zstd_INCLUDE_DIR`    -> `ZSTD_INCLUDE_DIR`
- `Zstd_LIBRARY`        -> `ZSTD_LIBRARY`

The old values continue to work, with a warning suggesting the new name.

Also:
- add similar warnings for earlier renames for mbedTLS and BearSSL.
- rename internal variables `PC_Zstd_*` to uppercase.

Follow-up to db39c668a8 #14542

Closes #14574
2024-08-17 21:23:51 +02:00
Daniel Stenberg
47a4864718
location: fix typo
Follow-up to 5fcf96930e
Bug: https://github.com/curl/curl/pull/14471#pullrequestreview-2244131475
Reported-by: Joshix-1 on github
2024-08-17 21:04:34 +02:00
XYenon
5fcf96930e
docs: add description of effect of --location-trusted on cookie
Closes #14471
2024-08-17 19:44:39 +02:00
Jan Venekamp
88727f7ed0
docs: improve cipher options documentation
Closes #14407
2024-08-17 11:14:21 +02:00
renovate[bot]
b2488afb18
GHA: update github/codeql-action digest to 429e197
Closes #14425
2024-08-17 11:03:09 +02:00
Viktor Petersson
6fc66e1676
SECURITY: mention OpenSSF best practices gold badge
Closes #14319
2024-08-17 11:01:16 +02:00
Justin Maggard
88cae14550
mbedtls: add more informative logging
After TLS handshare, indicate which TLS version was negotiated in
addition to the cipher in the handshake completed log message.

Also use the verify callback for certificate logging and collection.
This allows things to work even when MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
is disabled in the mbedtls library.

And lastly, catch certificate validation errors later so we can give the
user more informative error messages that indicate what the failure was
from certificate validation.

Tested on both current LTS versions (2.28 and 3.6).

Closes #14444
2024-08-17 10:57:45 +02:00
renovate[bot]
2c4d04c4d3
GHA: update dependency gnutls/gnutls to v3.8.7
Closes #14554
2024-08-17 10:53:41 +02:00
Stefan Eissing
a58b50fca6
transfer: Curl_sendrecv() and event related improvements
- Renames Curl_readwrite() to Curl_sendrecv() to reflect that it
  is mainly about talking to the server, not reads or writes to the
  client. Add a `nowp` parameter since the single caller already
  has this.
- Curl_sendrecv() now runs all possible operations whenever it is
  called and either it had been polling sockets or the 'select_bits'
  are set.
  POLL_IN/POLL_OUT are not always directly related to send/recv
  operations. Filters like HTTP/2, QUIC or TLS may monitor reverse
  directions. If a transfer does not want to send (KEEP_SEND), it
  will not do so, as before. Same for receives.
- Curl_update_timer() now checks the absolute timestamp of an expiry
  and the last/new timeout to determine if the application needs
  to stop/start/restart its timer. This fixes edge cases where
  updates did not happen as they should have.
- improved --test-event curl_easy_perform() simulation to handle
  situations where no sockets are registered but a timeout is
  in place.
- fixed bug in events_socket() that complained about removing
  a socket that was unknown, when indeed it had removed the socket
  just before, only it was the last in the list
- fixed conncache's internal handle to carry the multi instance
  (where the cache has one) so that operations on the closure handle
  trigger event callbacks correctly.
- fixed conncache to not POLL_REMOVE a socket twice when a conneciton
  was closed.

Closes #14561
2024-08-17 10:52:53 +02:00
Viktor Szakats
432f2fd9ac
cmake: sync up version detection in Find modules
- use the same pattern across all Find modules:
  - verify if the version header exists before reading it.
  - use a single regex per lookup.
  - sync regexes between Find modules.
  - use generic temporary variable names.
  - improve readability.
  - make it simpler to transition to new CMake syntax in the future:
    ```cmake
    file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str REGEX "<...>")
    unset(_version_str)
    set(CARES_VERSION "${CMAKE_MATCH_1}")
    ```
    Ref: https://cmake.org/cmake/help/latest/policy/CMP0159.html#policy:CMP0159

- fix zstd version detection to be CMake 3.7 compatible.
  Required 3.9 before this patch, for the `CMAKE_MATCH_<n>` feature.
  Follow-up to c5d506e9bb #12200

Follow-up to 4e2f3641f8 #14548

Closes #14572
2024-08-17 10:33:26 +02:00
Viktor Szakats
d8de4806e1
cmake: tidy-up continues
- move variable dump to a GHA foldable group.
- minimize scope for an include().
- rename `HIDES_CURL_PRIVATE_SYMBOLS` to `CURL_HIDES_PRIVATE_SYMBOLS`,
  to keep it in the curl namespace.
- drop quotes from a version number.
- add missing `Makefile.inc` var refs to comment.
- FindNGTCP2: rename internal var to underscore/lowercase.
- FindBearSSL, FindGSS: whitespace.

Closes #14571
2024-08-17 00:32:38 +02:00
Viktor Szakats
f3a03df6a1
cmake: revert to pkg_check_modules()
Prefer `pkg_check_modules()` over `pkg_search_module()`.

`pkg_check_modules()` logs a line when there is a hit, and also warnings
if a sub-dependency is missing. In `QUIET` mode, both are silent.

The extra info is useful to see if a detection happened via
`pkg-config`.

Keep `pkg_search_module()` in `FindGSS`. We pass two dependencies
there and we want to keep stopping on the first one.

Partially reverts c2889a7b41 #14388

Closes #14573
2024-08-17 00:31:52 +02:00
Viktor Szakats
4beb236478
cmake: fixup variable reference in FindZstd
Follow-up to 4e2f3641f8 #14548
2024-08-16 19:10:46 +02:00
Daniel Stenberg
f9f2eaaec3
internals/SPLAY.md: internal API documentation
Closes #14563
2024-08-16 17:13:37 +02:00
Daniel Stenberg
8f562f744c
curl: make the progress bar detect terminal width changes
And up the widest supported bar to 400 columns.

Fixes #14565
Reported-by: lolbinarycat on github
Closes #14570
2024-08-16 17:05:28 +02:00
Viktor Szakats
4e2f3641f8
cmake: add missing version detection to Find modules
- use `pkg-config` version when available and where it wasn't yet used.

- add manual version detection for dependencies where this is possible
  (via a public header) and where it wasn't done yet.

Closes #14548
2024-08-16 16:53:44 +02:00
Viktor Szakats
2bea3892e7
GHA/windows: delete redundant options, tidy up
- delete redundant `-DCURL_USE_LIBPSL=ON`.

- delete redundant `-DUSE_NGHTTP2=ON`.
  Follow-up to 87aa4ebd82 #14136

- reorder options.

Closes #14569
2024-08-16 16:05:36 +02:00
Viktor Szakats
453d032b26
tidy-up: misc build, tests, lib/macos.c
- mkhelp.pl: drop unused assigment.
- Makefile.mk: update a comment.
- lib/macos.c: delete redundant block.
- fix two typos.

Closes #14558
2024-08-16 16:05:36 +02:00
Daniel Stenberg
471b11a9fd
RELEASE-NOTES: synced 2024-08-16 14:52:34 +02:00
Daniel Stenberg
0e06603b23
docs: remove ALTSVC.md, HSTS.md, HTTP2.md and PARALLEL-TRANSFERS.md
These are files and documentation for established functionality that
should by now be covered properly and completely in the standard
documentation and in everything curl. Having these extra files provides
duplicated information where they risk being out of sync.

Closes #14553
2024-08-16 13:49:00 +02:00
Jan Venekamp
1e03d4bc0b
rustls: add support for setting TLS version and ciphers
Add support for CURLOPT_SSLVERSION, CURLOPT_TLS13_CIPHERS and
CURLOPT_SSL_CIPHER_LIST.

Closes #14535
2024-08-16 09:55:02 +02:00
Viktor Szakats
0d8fdd1c74
cmake: add wolfSSH support
Enable with CMake option `-DCURL_USE_WOLFSSH=ON`. Customize with
`-DWOLFSSH_INCLUDE_DIR=<path-to-wolfssh>/include`,
`-DWOLFSSH_LIBRARY=<path-to-wolfssh>/lib/libwolfssh.a`.

It requires the wolfSSL TLS backend.

Closes #14568
2024-08-16 09:36:57 +02:00
Jan Venekamp
3ff147f8ba
cmake: TLS 1.3 warning only for bearssl and sectranp
Closes #14566
2024-08-16 09:36:37 +02:00
Daniel Stenberg
dcb51bafab
splay: use access functions, add asserts, use Curl_timediff
- add set/get functions for the custom data in a tree node

- use Curl_timediff for time comparisons instead of the custom macro, as they
  do the exact same things.

- add asserts to catch mistakes better

- updated test 1309 accordingly

Closes #14562
2024-08-16 09:12:13 +02:00
Stefan Eissing
6c5a7af754
scorecard: tweak request measurements
Increase max-parallel up to 300, the curl max

Tweak output to just give the http response code

Closes #14564
2024-08-16 09:10:09 +02:00
Daniel Stenberg
20aa8d8f31
docs/internals: new subdirectory
For libcurl internal APIs and concepts.

Closes #14552
2024-08-16 08:59:25 +02:00
Daniel Stenberg
3932964793
test1707: output diff more for debugging differences in CI outputs 2024-08-16 08:57:19 +02:00
Daniel Stenberg
0066d169e8
managen: wordwrap long example lines in ASCII output
The entire ASCII version of the manpage word wraps at a fixed column,
while example command lines can easily go wider than so.

This change now makes manage work on wrapping long example command lines
to make them look nicer. And also to avoid triggering the build error
caused by too long lines in the output.

Quoted lines cannot be wrapped, so managen now errors out if they are
"too long". With this addition, the 'maxline' script is removed as it is
no longer needed.

Closes #14543
2024-08-16 08:57:19 +02:00
Jan Venekamp
178e8ba2d1
cmake: fix find rustls
Follow-up to 2784801977 #14545
Closes #14567
2024-08-15 23:09:09 +02:00
Daniel Stenberg
160f023359
multi: on socket callback error, remove socket hash entry nonetheless
Previously an error from the callback accidentally made libcurl keep the
hash entry which would lead to the entry remaining and then potentially
getting removed *again* which would lead to internal confusions.

This is an old issue (introduced in 2b3dd01b77), caught by the new
asserts from c0233a35da.

Closes #14557
2024-08-15 18:49:16 +02:00
Viktor Szakats
ef1d606d1b
libcurl.pc: add reference to libgsasl
Closes #14556
2024-08-15 15:30:09 +02:00
Viktor Szakats
b042d5297d
tidy-up: misc spelling (bit, ASCII)
Closes #14559
2024-08-15 15:30:09 +02:00
Daniel Stenberg
551baf7d64
tests: move the disabling of 500 for hyper from CI to DISABLED
Follow-up to 136504195a

Closes #14551
2024-08-15 14:02:40 +02:00
Daniel Stenberg
5603204448
curl: fix the -w urle.* variables
urle.scheme, urle.user, urle.password and urle.options mistakenly
operated on the original URL instead of the *effective* (last) URL.

Add test 474 to verify.

Reported-by: Gruber Glass
Fixes #14550
Closes #14560
2024-08-15 14:01:24 +02:00
Viktor Szakats
2401ee68a4
cmake: show warning if libpsl is not found
Also:
- explicitly disable libpsl in CI to avoid configure warning, where
  necessary.
- add TODO to make this warning an error (to match autotools.)

Follow-up to 2998874bb6 #12661

Closes #14533
2024-08-15 10:38:46 +02:00
Stefan Eissing
c90a3f16b8
mime: avoid inifite loop in client reader
Curl_mime_read() may go into an infinite loop when called with buffer
lengths <= 4. Some encoders, like base64, are not prepared for that.

In the client reader for mime data, skip such small reads. The upload
buffers will get flushed eventually and larger reads will happen again.

Improves robustness of test652 which triggered the loop on blocked
sends.

Closes #14532
2024-08-15 10:16:55 +02:00
Viktor Szakats
9f23c8f201
cmake: fix and tidy up c-ares builds, enable in more CI jobs
- set `CARES_NO_DEPRECATED` to avoid c-ares deprecation warnings.
  Like autotools does.

- drop unused c-ares header directory when building libtests and test
  servers.

- disable TrackMemory (aka `CURLDEBUG`) feature for MSVC builds.
  It fails on test 558 and 1330, saying that TrackMemory isn't working.
  Left a FIXME about it.

- GHA/macos: enable c-ares in a cmake job.

- GHA/windows: enable c-ares in MSVC job.
  Fixes #14202

- GHA/windows: add c-ares mingw autotools job with tests.
  (move `--with-windows-unicode` option from 'default' job to
  this one to keep the former "default".)
  Put these tests on ignore for now:
  ```
  FAIL 472: 'aws-sigv4 with query' HTTP, aws-sigv4
  FAIL 1299: 'Send "OPTIONS *" with --request-target' HTTP, --request-target
  FAIL 1613: 'Send "OPTIONS *" with --request-target to a proxy' HTTP, HTTP proxy, --request-target
  ```
  Ref: https://github.com/curl/curl/actions/runs/10388126947/job/28765761441#step:15:5902

  472: fails with mingw despite Unicode enabled.
  1299, 1613: seem like a case of expanding '*' to a filename.

- GHA/windows: enable c-ares in mingw cmake job.

Closes #14541
2024-08-15 09:44:52 +02:00
Viktor Szakats
304a349e8c
GHA/configure-vs-cmake: add macOS build, fix issues
- sync cmake macOS `OS` value manually with the autotools one.
- stop exporting/subst-ing `HAVE_OPENSSL_QUIC` from autotools.
  The variable was only used internally.
- exclude a dependency detection symbol.
- allow to run when the workflow itself was updated.
- simplify cmake command.
- fix indentation.

Closes #14546
2024-08-15 09:29:07 +02:00
Viktor Szakats
2784801977
cmake: add missing pkg-config hints to Find modules
- brotli, c-ares, libpsl, libssh2, mbedtls, rustls:
  Use `pkg-config` for path hints and version info. Syncing them up with
  the rest of Find modules.

- GHA/macos: force-disable libssh2 with cmake to sync with autotools.
  After this patch, cmake auto-detects libssh2 in this job.

Closes #14545
2024-08-15 09:29:06 +02:00
Daniel Stenberg
dd3b3eca5b
RELEASE-NOTES: synced 2024-08-15 09:09:41 +02:00
Alex Snast
136504195a
getinfo: add CURLINFO_POSTTRANSFER_TIME_T
Returns the time, in microseconds, from the start until the last byte is
sent by libcurl (i.e. the request is sent off).

Closes #14189
2024-08-15 09:02:58 +02:00