Commit Graph

32787 Commits

Author SHA1 Message Date
Viktor Szakats
8a3740bc8e
curl: support embedding a CA bundle
Add the ability to embed a CA bundle into the curl binary. It is used
when no other runtime or build-time option set one.

This helps curl-for-win macOS and Linux builds to run standalone, and
also helps Windows builds to avoid picking up the CA bundle from an
arbitrary (possibly world-writable) location (though this behaviour is
not currently disablable).

Usage:
- cmake: `-DCURL_CA_EMBED=/path/to/curl-ca-bundle.crt`
- autotools: `--with-ca-embed=/path/to/curl-ca-bundle.crt`
- Makefile.mk: `CURL_CA_EMBED=/path/to/curl-ca-bundle.crt`

Also add new command-line option `--dump-ca-embed` to dump the embedded
CA bundle to standard output.

Closes #14059
2024-08-03 09:22:26 +02:00
Viktor Szakats
87aa4ebd82
cmake: detect nghttp2 via pkg-config, enable by default
- also detect nghttp2 via `pkg-config` to match nghttp3 detection
  and autotools.

- enable nghttp2 by default to match autotools.

Cherry-picked from #14097
Closes #14136
2024-08-03 09:22:26 +02:00
Viktor Szakats
f518c73a87
cmake: drop unused internal variable
Closes #14361
2024-08-03 09:22:26 +02:00
Tal Regev
bb9c15e97a
vtls: fix MSVC 'cast truncates constant value' warning
Fixes:
```
curl\lib\vtls\cipher_suite.c(193,3): error C2220: the following warning is treated as an error
curl\lib\vtls\cipher_suite.c(193,3): warning C4310: cast truncates constant value
```

Closes #14341
2024-08-03 09:22:25 +02:00
renovate[bot]
170c28805a
ci: Update actions/upload-artifact digest to 89ef406
Closes #14359
2024-08-03 09:22:25 +02:00
Viktor Szakats
b6089c35d9
cmake: drop reference to undefined variable
Undefined since the initial commit adding CMake support.

Closes #14358
2024-08-03 01:21:23 +02:00
Viktor Szakats
f5b826532f
cmake: drop no-op tests/data/CMakeLists.txt
It's a no-op since
d162fca69a #9333 (2022-08-18).

Also revert 476499c75c that is
no longer necessary: move `Makefile.inc` back into `Makefile.am`.

Closes #14357
2024-08-03 01:15:45 +02:00
Viktor Szakats
f87c3363ef
cmake: drop custom CMakeOutput.log/CMakeError.log logs
CMake writes this information into `CMakeConfigureLog.yaml`
automatically.

Closes #14356
2024-08-03 01:15:45 +02:00
Stefan Eissing
39b9ccea8d
x509asn1: raise size limit for x509 certification information
Raise the limit for certification information from 10 thousand to 100
thousand bytes. Certificates can be larger than 10k.

Change the infof() debug output to add '...' at the end when the max
limit it can handle is exceeded.

Reported-by: Sergio Durigan Junior
Fixes #14352
Closes #14354
2024-08-02 23:20:57 +02:00
Daniel Stenberg
d2abf8dede
GHA/distcheck: add a reproducible release check 2024-08-02 23:05:41 +02:00
Daniel Stenberg
86039e6e42
verify-release: shell script that verifies a release tarball
This script remakes a provided curl release and verifies that the newly
built version is identical to the original file.

Due to bugs in releases up to and including curl 8.9.1, it does not work
on tarballs generated before commit 754acd1a9d.

Closes #14350
2024-08-02 23:05:41 +02:00
Daniel Stenberg
fab526c032
Makefile: remove 'scripts' duplicate from DIST_SUBDIRS
Also fix the .dist replacing by avoiding all Makefiles because it
otherwise also went into the temporary release folder and got confused
about the Makefile.dist in there.
2024-08-02 23:05:41 +02:00
Daniel Stenberg
d0afb33959
dmaketgz: only run 'make distclean' if Makefile exists
... so that we can avoid the build failure if we run this in a clean
checkout.

Also remove -it from the docker invoke since it is not interactive and
it needs no TTY. They made the job fail in the CI.
2024-08-02 23:05:41 +02:00
Viktor Szakats
4d34fd26db
autotools: fix typo in tests/data target
Ref: c1b369fd4c (2002-12-12)
Closes #14355
2024-08-02 14:36:16 +02:00
Viktor Szakats
c6cf411bac
GHA/non-native: reduce FreeBSD test parallelism to -j8 [ci skip]
To reduce flakiness.
2024-08-02 14:36:13 +02:00
Stefan Eissing
45246ebca1
tests: gitignore newly generated files
Closes #14351
2024-08-02 11:19:10 +02:00
Stefan Eissing
ba44ac62e3
progress: ratelimit/progress tweaks
- multi.c: when ratelimiting a transfer stops (MSTATE_RATELIMITING ->
  MSTATE_PERFORMING), run the MSTATE_PERFORMING state right away

- urldata.h: factor out upload and download progress counters into a
  struct, use that for passing these to progress update functions

- progress.c/getinfo.c: change names of moved progress counters

- progress.c: use new structs and a helper struct to factor repeated
  calculation into static helpers

Closes #14335
2024-08-02 11:17:44 +02:00
Stefan Eissing
eb0a366b70
http2: improve rate limiting of downloads
Set the initial stream window size to 64KB and increase that to the 10MB
we used to start with on the first server reply, unless a rate limit is
in effect.

Continously monitory changes to the transfers rate limit and adjust the
stream window size accordingly. `max_recv_speed` is a transfer propert
that can be changed during processing by a callback.

Closes #14326
2024-08-02 08:45:01 +02:00
renovate[bot]
4abf97b0a6
GHA: update awslabs/aws-lc to v1.33.0
Closes #14347
2024-08-02 08:43:17 +02:00
Stefan Eissing
f6cb3c6308
tests/http: configure test httpd to honor client cipher order
Let the client, e.g. curl, influence the cipher selected in a TLS
handshake. TLS backends have different preferences and honor that
in httpd the same as Caddy does.

Also makes for a more fair compare of different TLS backends.

Closes #14338
2024-08-02 08:32:34 +02:00
Daniel Stenberg
754acd1a9d
dist: fix reproducible build from release tarball
Make it possible to rebuild an identical copy from a release tarball. It
was previously only possible from a checked out git repository.

- add release-tools.sh to dist
- keep Makefile.dist around to include it in dist
- regenerate tool_huge.c with the new version in dist
- fix the dist CI job to not do make clean like before

Closes #14336
2024-08-02 08:28:56 +02:00
Tal Regev
c73b80a3cd
cmake: add gnutls to multissl feature
Closes #14345
2024-08-02 08:27:31 +02:00
Daniel Stenberg
1f61db5907
curl: allow 500MB data URL encode strings
Previously it would bail out of the generated data reached 8MB in
memory.

Reported-by: Antoine du Hamel
Fixes #14337
Closes #14340
2024-08-02 08:26:36 +02:00
Daniel Stenberg
9bfc7f9234
escape: allow curl_easy_escape to generate 3*input length output
Instead of capping it to the 3 * CURL_MAX_INPUT_LENGTH. To allow users
to URL encode larger chunks of data.

Closes #14339
2024-08-01 23:03:21 +02:00
Daniel Stenberg
8a9c22796b
CHANGES: rename to CHANGES.md, no longer generated
- scripts/log2changes.pl was not included in release tarballs, which broke
  reproducible builds

- since log2changes uses git to generate the contents, it makes it difficult
  to generate the same contents later (it would need to be fixed)

- the CHANGES file has outlived its purpose. the main changes are in the
  RELEASE-NOTES, the rest are better tracked directly using git or on GitHub

- put a fixed CHANGES.md in there instead pointing out where the info lives
  now

Closes #14331
2024-08-01 13:37:12 +02:00
Daniel Stenberg
12774f4505
RELEASE-NOTES: synced
Plus add a link to https://curl.se/changes.html
2024-08-01 13:36:28 +02:00
Daniel Stenberg
e3240db0a7
GHA: scan git repository and detect unvetted binary files
The only binary-looking files that are accepted in the git repository
need to match the checksums in the sha256sum file
".github/scripts/binarycheck.sums".

This is done to make sure that no one has planted any hidden (encrypted)
potentially dangerous payload in the tree.

Closes #14333
2024-08-01 12:30:36 +02:00
Viktor Szakats
c3fe2dd25c
GHA/windows: drop FTP tests
Try reducing hangs.

Closes #14330
2024-08-01 00:32:00 +02:00
Tal Regev
a79dc7b601
GHA/windows: remove vcpkg bin path in MSVC jobs
- the path is wrong, because we compile on debug, and we are using
  the release bin path.
- the path is not needed, cmake curl copy the needed dlls to the
  compilation cmake folder where the curl exe is found.

Closes #14329
2024-08-01 00:32:00 +02:00
Viktor Szakats
0d12528729
GHA/windows: timeout earlier with hung tests
Finishing tests takes on average 10 or less minutes depending on
platform. Reduce job step timeouts to reflect that. It helps
concluding hung/failed tests earlier, which allows to retry them
earlier.

This makes it more difficult to tell from a job if it hung or not,
because we lose the long runtime as a telltale sign. Let's see how it
works out and adjust as necessary.

Also fix a comment while here.

Closes #14236
2024-08-01 00:32:00 +02:00
Daniel Stenberg
65ece771f4
INSTALL.md: MultiSSL and QUIC are mutually exclusive
Reported-by: Matt Jolly
Fixes #14308
Closes #14328
2024-07-31 23:26:40 +02:00
Stefan Eissing
02e0151a3a
lib: convert some debugf()s into traces
Use CURL_TRC_CF() for some useful tracing information instead of
DEBUGF().

Closes #14322
2024-07-31 23:14:24 +02:00
Viktor Szakats
a118a6ecdd
cmake: distcheck for files in CMake subdir
- add CMake option to verify if the `CMake/*.cmake`, `CMake/*.in` files
  are listed as distributable in autotools' `EXTRA_DIST`. The check can
  be enabled with `-DENABLE_DIST_TEST=ON` CMake option.

- add CI job to that effect.

Ref: #14320
Closes #14323
2024-07-31 22:31:56 +02:00
Viktor Szakats
404679d25f
libcurl.pc: add Cflags.private
Ref: https://manpages.debian.org/bookworm/pkgconf/pc.5.en.html#PROPERTY_KEYWORDS
Ref: https://www.msys2.org/docs/pkgconfig/#cflagsprivate-static-libraries

Closes #14321
2024-07-31 20:24:30 +02:00
Viktor Szakats
58946eed20
dist: add missing FindNettle.cmake
Follow-up to 669ce42275 #14285
Reported-by: Christoph Reiter
Bug: https://github.com/curl/curl/pull/14285#issuecomment-2259880050
Closes #14320
2024-07-31 16:34:09 +02:00
Daniel Stenberg
8f89218b19
tests: provide docs a as curldown, not nroff
As runtests.md and testcurl.md. Very few people actually need these as
manpages anyway.

With this, we have no more nroff formatted documents in git.

Closes #14324
2024-07-31 14:51:12 +02:00
Daniel Stenberg
a9f63b8e0e
RELEASE-NOTES: synced
Bump to 8.10.0
2024-07-31 10:48:48 +02:00
Joe Birr-Pixton
dd95a49d49
rustls: make all tests pass
- supports IP addresses in certs since 0.21
- Remove workaround, and re-enable tests

Closes #14317
2024-07-31 10:44:10 +02:00
Tal Regev
ec41cfb809
GHA/windows: enable MulitSSL in an MSVC job
Ref: 98da147b18 #14305
Closes #14276
2024-07-31 10:22:34 +02:00
Daniel Stenberg
83bedbd730
RELEASE-NOTES: synced 2024-07-31 08:50:04 +02:00
Daniel Stenberg
6ba773b6db
THANKS: add names from the 8.9.1 release notes
Also remove duplicates
2024-07-31 08:50:04 +02:00
Stefan Eissing
27959ecce7
x509asn1: unittests and fixes for gtime2str
Fix issues in GTime2str() and add unit test cases to verify correct
behaviour.

Follow-up to 3c914bc680

Closes #14316
2024-07-30 23:08:59 +02:00
Tal Regev
98da147b18
vtls: avoid forward declaration in MultiSSL builds
The MSVC compiler cannot have forward declaration with const and static
variable, causing this error:
```
curl\lib\vtls\vtls.c(417,44): warning C4132: 'Curl_ssl_multi': const object should be initialized
```

Ref: #14276
Closes #14305
2024-07-30 22:11:20 +02:00
Viktor Szakats
8153b8e580
tidy-up: URL updates (one more)
Follow-up to 767d5811b5 #14318
2024-07-30 21:36:39 +02:00
Viktor Szakats
767d5811b5
tidy-up: URL updates
Closes #14318
2024-07-30 21:27:12 +02:00
Viktor Szakats
b92ead34dd
cmake: drop if(PKG_CONFIG_FOUND) guard for pkg_check_modules()
The oldest cmake supported by curl is v3.7.0, which already has such
guard (using `PKG_CONFIG_EXECUTABLE`) inside `pkg_check_modules()`. The
advantage of leaving that guard to CMake is that it will define/reset
all output variables, while the manual guard doesn't do this and also
leaves for example `NETTLE_FOUND` undefined.

Delete the single use of this guard from the recently added `nettle`
detection, where I included it by accident. Then possibly re-introduce
it universally if we find it useful after more evaluation.

Follow-up to 669ce42275 #14285
Closes #14309
2024-07-30 14:33:50 +02:00
Daniel Stenberg
d40bba3ff9
mailmap: dedupe an author showing up twice in shortlog -s 2024-07-30 14:25:30 +02:00
Ivan Kuchin
b2696ac37a
misc: cleanup after removing years from copyright
- remove leftover copyright years from few test files
- fix email in copyright lines
- consistent format of copyright lines

Closes #14312
2024-07-30 14:11:48 +02:00
Alex Snast
f87a958e9e
wolfssl: avoid calling get_cached_x509_store if store is uncachable
There's no need for get_cached_x509_store call if the return value won't
be used for caching anyway.

Closes #14306
2024-07-30 13:02:17 +02:00
Daniel Stenberg
e358a6e542
contrithanks.sh: use -F with -v to match lines as strings
Makes names involving [brackets] work.
2024-07-30 12:17:00 +02:00