Commit Graph

34209 Commits

Author SHA1 Message Date
Daniel Stenberg
616b66e68f
scripts/delta: add number of days since first httpget release 2025-01-08 23:48:48 +01:00
Stefan Eissing
4e15605896
HTTP/2: strip TE request header
The TE request header field is invalid in HTTP/2. Since clients may not
know in advance if a connection negotiates HTTP/2, automatically strip
such a header when h2 is in play.

Add test_01_10 to verify.

Reported-by: Jiri Stary
Fixes #15941
Closes #15943
2025-01-08 23:44:51 +01:00
Stefan Eissing
515a21f350
vtls: feature ssls-export for SSL session im-/export
Adds the experimental feature `ssls-export` to libcurl and curl for
importing and exporting SSL sessions from/to a file.

* add functions to libcurl API
* add command line option `--ssl-sessions <filename>` to curl
* add documenation
* add support in configure
* add support in cmake
+ add pytest case

Closes #15924
2025-01-08 23:32:07 +01:00
Viktor Szakats
8a1ee2b47d
appveyor: tidy up shell code
Closes #15940
2025-01-08 18:16:50 +01:00
Viktor Szakats
d34aeecb08
appveyor: bump VS2008 jobs to VS2010
VS2008 has been partly broken for a while with its shared-debug builds
crashing on startup. Its compiler output (UTF-16 HTML) was also barely
readable even after conversion. It's also the only platform in CI
missing `stdint.h`.

This patch migrates a VS2008 job to VS2010 and drops another that
already had a VS2010 equivalent.

We recommend switching to VS2010 or newer when using MSVC to build curl.

Ref: #15907
Closes #15934
2025-01-08 12:33:31 +01:00
Viktor Szakats
38ff7ba501
appveyor: always use cmake -A option to select x64
The `Win64` generator suffix alternative was required by old CMake
versions (<3.1) only:
https://cmake.org/cmake/help/v3.22/generator/Visual%20Studio%2010%202010.html

Closes #15935
2025-01-08 00:33:02 +01:00
Viktor Szakats
cba0d3abcb
appveyor: reorder builds to get useful results earlier
Also to align with existing VS2010. Keeping the VS2008 job first to give
a quick sniff test for MSVC builds.

Follow-up to 08ff33e483 #15923
Follow-up to 50f6a6b1d4 #15926

Closes #15932
2025-01-07 20:14:03 +01:00
Viktor Szakats
0cacdd6dd1
GHA/windows: drop MSH3 job (broken after 0.7.0 bump)
Starting GHA runner image 20250105.1.0.

As seen on Linux with 0.7.0:
```
/home/runner/msh3/include/msh3.h:377:18: error: width of ‘RESERVED’ exceeds its type
  377 |             bool RESERVED                 : 5;
      |                  ^~~~~~~~
/home/runner/msh3/include/msh3.h:490:18: error: width of ‘RESERVED’ exceeds its type
  490 |             bool RESERVED            : 7;
      |                  ^~~~~~~~
```
https://github.com/curl/curl/actions/runs/12655717818/job/35266716846#step:35:195

Bug: https://github.com/curl/curl/pull/15924#issuecomment-2575106711
Bug: https://github.com/curl/curl/pull/15930#issuecomment-2575842486

Closes #15927
2025-01-07 18:27:32 +01:00
Viktor Szakats
24ef9de9f4
content_encoding: namespace GZIP flag constants
To avoid collision with a 3rd-party `RESERVED` symbols.

This symbol is used in the public header of MSH3 0.7.0.

Closes #15929
2025-01-07 17:54:19 +01:00
Daniel Stenberg
0cc458686c
cookie: small variable type cleanups
- bump cookie counter and "creation time" to use 'unsigned int'
- use BIT() for single-bit struct field
- make invalid_octets() return bool properly

Closes #15921
2025-01-07 16:47:18 +01:00
Viktor Szakats
f6566f332f
cmake: pre-fill HAVE_STDINT_H on Windows
Closes #15925
2025-01-07 15:37:36 +01:00
Viktor Szakats
554d4aee4d
appveyor: fixup job name
Follow-up to 50f6a6b1d4 #15926
2025-01-07 15:02:22 +01:00
Viktor Szakats
50f6a6b1d4
msvc: add VS2012 CI job, fix compiler warnings in LDAP and tests
Follow-up to 8cfc936f5c #10674
Follow-up to d620ec6791 #14700

Closes #15926
2025-01-07 14:51:48 +01:00
Viktor Szakats
08ff33e483
msvc: fix building with HAVE_INET_NTOP and MSVC <=1900
MSVC 1900 and older is missing a `const` specifier in the `inet_ntop()`
declaration for the second argument. A workaround was in place for it
in cmake, but it didn't cover all necessary versions.

Replace the workaround with a different one, move it to `lib/inet_ntop.c`
and extend to all necessary MSVC versions.

Also add CI jobs for the older MSVC versions: 2013, 2015, 2017.

Closes #15923
2025-01-07 14:07:19 +01:00
renovate[bot]
4e6de2f43f
GHA/linux: update awslabs/aws-lc to v1.42.0
Closes #15919
2025-01-06 23:35:03 +01:00
dependabot[bot]
d2dee6bd0d
GHA: bump cygwin/cygwin-install-action from 4 to 5
Bumps [cygwin/cygwin-install-action](https://github.com/cygwin/cygwin-install-action) from 4 to 5.
- [Release notes](https://github.com/cygwin/cygwin-install-action/releases)
- [Commits](006ad0b094...f61179d722)

---
updated-dependencies:
- dependency-name: cygwin/cygwin-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Closes #15918
2025-01-06 23:11:17 +01:00
Stefan Eissing
bd3c027ac9
conncache: count shutdowns against host and max limits
Count connections to a host against a possibly configured destination
limit. Trigger multi `connchange` when a connection has been shutdown,
so pending transfers can try to get a connection once again.

Reported-by: baranyaib90 on github
Fixes #15857
Closes #15879
2025-01-06 23:10:23 +01:00
Daniel Stenberg
508861eb80
RELEASE-NOTES: synced 2025-01-06 14:11:15 +01:00
Patrick Monnerat
1b3f00f794
mime: explicitly rewind subparts at attachment time.
Subparts may have been previously used as a top-level mime structure and
thus not rewound.

New test 695 checks the proper functioning in these particular conditions.

Reported-by: Qriist on github
Fixes #15842
Closes #15911
2025-01-06 14:03:42 +01:00
Yedaya Katsman
e602f7f119
docs/examples/checksrc: don't allow snprintf specifically
This isn't needed anymore after https://github.com/curl/curl/pull/15835,
since banned functions are just allowed in general in
`docs/examples/.checksrc`, and emits a warning when running make
checksrc:

`invalid warning specified in .checksrc: "SNPRINTF"`

Closes #15916
2025-01-06 13:49:21 +01:00
Viktor Szakats
a3a131b2a6
autotools: silence gcc warnings in libtool code
```
./.libs/lt-upload-pausing.c: In function 'lt_fatal':
./.libs/lt-upload-pausing.c:593:1: warning: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]
  593 | lt_fatal (const char *file, int line, const char *message, ...)
      | ^~~~~~~~
```
https://github.com/curl/curl/actions/runs/12611924141/job/35148104431?pr=15911#step:11:264

Ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsuggest-attribute_003d

Closes #15915
2025-01-05 17:15:05 +01:00
Daniel Stenberg
893e57e84c
INFRASTRUCTURE.md: project infra
Closes #15906
2025-01-05 11:25:06 +01:00
Viktor Szakats
699ac9430c
cmake: publish/check supported protocols/features via CURLConfig.cmake
Via these variables, as lists:
- `CURL_SUPPORTED_PROTOCOLS`
- `CURL_SUPPORTED_FEATURES`

As individual flags:
- `CURL_SUPPORTS_<protocol/feature>` = `TRUE`

Also:
- set `CURL_VERSION_STRING` which was missing when using
  `find_package(CURL CONFIG)` or
  `find_package(CURL NO_MODULE)`.
- set `CURL_<prototol/feature>_FOUND` for compatibility.
- show full list of missing but required `COMPONENTS`.

Assisted-by: Derek Huang
Fixes #15854
Closes #15858
2025-01-04 10:29:00 +01:00
Daniel Stenberg
f62be9cfb6
checkdocs: trim links off docs/ markdowns before spellcheck
So that we can use words in links without having them spellchecked.

Closes #15910
2025-01-03 18:38:04 +01:00
Daniel Stenberg
cc16211a30
cleancmd.pl: strip out backticked words
To make sure they are not spellchecked. Also, leaving two backticks is
not good because they cause the spellchecker to misinterpret the
markdown file so they have to be removed as well.
2025-01-03 18:36:50 +01:00
Daniel Stenberg
0e120c5b92
netrc: 'default' with no credentials is not a match
Test 486 verifies.

Reported-by: Yihang Zhou

Closes #15908
2025-01-03 18:21:10 +01:00
Daniel Stenberg
abf8062449
CURLOPT_SEEKFUNCTION.md: used for FTP, HTTP and SFTP (only)
The same goes for *SEEKDATA.

Closes #15903
2025-01-02 22:31:11 +01:00
Viktor Szakats
852692b24f
GHA/http3-linux: fix cache rebuild conditions, switch to wolfSSL stable
ngtcp2 depends on crypto backends. nghttp2 depends on ngtcp2 and nghttp3
(for nghttpx server used in pytests).

Before this patch, ngtcp2, nghttp2 weren't rebuilt when their
dependencies changes. This worked fine until wolfSSL bumped its
soversion and caused CI to fail because ngtcp2 was not rebuilt and was
still referring to the old soname that was no longer offered by the
wolfSSL package.

Make sure to rebuild ngtcp2/nghttp2 when any of their dependencies bump.
To avoid rebuilding everything on every wolfSSL commit, switch to use
wolfSSL stable versions.

Bug: https://github.com/curl/curl/pull/15882#issuecomment-2566821417
Closes #15885
2025-01-02 21:04:02 +01:00
prpr19xx on github
d984209e59
smb: fix compiler warning
An old version of GCC (4.5.2 on a mipsel) moans about the constant being
too big to fit in a long.

Closes #15902
2025-01-02 18:01:17 +01:00
Daniel Stenberg
3eb57d6ba7
docs: use lowercase curl and libcurl
Adjusted badwords to find them.

Plus: make badwords run on all markdown files in the repo and update
markdowns previously unchecked

Closes #15898
2025-01-02 17:15:54 +01:00
Daniel Stenberg
e694c8284a
docs/libcurl/opts: clarify the return values
Expand a little.

- mention the type name of the return code
- avoid stating which exact return codes that might be returned, as that
  varies over time, builds and conditions
- avoid stating some always return OK
- refer to the manpage documenting all the return codes

Closes #15900
2025-01-02 17:13:33 +01:00
Daniel Stenberg
e256d9df6d
docs/cmdline-opts/_ENVIRONMENT.md: minor language fix
Closes #15897
2025-01-02 17:02:26 +01:00
Daniel Stenberg
4501b7e28d
docs/libcurl: return value overhall
Unified, extended, clarified the return values for numerous functions

Closes #15899
2025-01-02 16:58:05 +01:00
Viktor Szakats
41e5a116a1
src: drop support for CURL_TESTDIR debug env
No longer used by curl tests.

`--output-dir` option can be used as an alternative in all builds.

Follow-up to 39697dead3 #15114
Closes #15893
2025-01-02 14:44:39 +01:00
Viktor Szakats
772b6933bc
cmake/FindLDAP: avoid framework locations for libs too (Apple)
We already avoid system framework paths while looking for LDAP headers
to avoid issues.

Do the same while looking for LDAP libraries. This makes sure to find
the regular ldap library (`libldap.tbd`) instead of picking up
`ldap.framework` and let that seep into `libcurl.pc` with a full path.

This makes LDAP detection work on Apple as before introducing FindLDAP.

Follow-up to 49f2a23d50 #15273
Closes #15895
2025-01-02 12:55:50 +01:00
Viktor Szakats
27b9e76706
cmake: make system libraries dl, m, pthread customizable
via `DL_LIBRARY`, `MATH_LIBRARY`, `PTHREAD_LIBRARY` variables.

They are used in Rustls, wolfSSL Find modules.

Also:
- always use `NAMES` keyword in `find_library()` calls.
- respect `find_library()` results for `dl`, `m`, `pthread`.
- formatting.

Closes #15892
2025-01-02 12:55:50 +01:00
Viktor Szakats
9a9498ea1e
curl_sha512_256: rename symbols to the curl namespace
Closes #15894
2025-01-02 12:55:50 +01:00
Daniel Stenberg
91587522a1
docs/HTTP-COOKIES.md: link to more information
Closes #15891
2025-01-01 22:45:48 +01:00
Daniel Stenberg
7fb113f01f
hash: add asserts in hash_element_dtor()
This just adds a precaution and shows a clear intention in the code.
Added because CodeSonar is reporting a false positive Use After Free on
this function.

Closes #15889
2025-01-01 21:13:38 +01:00
Daniel Stenberg
7fed7274e4
COPYING: bump copyright year range to 1996 - 2025
Closes #15890
2025-01-01 21:12:12 +01:00
Daniel Stenberg
af4e85925d
select: avoid a NULL deref in cwfds_add_sock
curl_multi_waitfds(m, NULL, ...);

=> Curl_waitfds_init(&cwfds, ufds, size);

=> Curl_waitfds_add_ps(&cwfds);

=>   cwfds_add_sock(cwfds, ...);

Would then try to use the ->wfds array while set to NULL previously.
This should not happen, which this is now also protected with an assert
to trigger debug builds if it happens.

Caught by CodeSonar

Assisted-by: Jay Satiro

Closes #15881
2025-01-01 20:56:27 +01:00
Daniel Stenberg
26a672260b
RELEASE-NOTES: synced 2025-01-01 14:50:59 +01:00
Jakub Jelen
999cc818c5
openssl: add support to use keys and certificates from PKCS#11 provider
In OpenSSL < 3.0, the modularity was provided by mechanism called
"engines". This is supported in curl, but the engines got deprecated
with OpenSSL 3.0 in favor of more versatile providers.

This adds a support for OpenSSL Providers, to use PKCS#11 keys, namely
through the pkcs11 provider. This is done using similar approach as the
engines and this is automatically built in when the OpenSSL 3 and newer
is used.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>

Closes #15587
2025-01-01 14:47:31 +01:00
Viktor Szakats
d1336ca14a
GHA/http3-linux: drop redundant pkg-config paths for ngtcp2/nghttp2
- ngtcp2: drop `$PWD/build` (= self)
- ngtcp2: drop nghttp3. It's only used for examples, which we do not use
  here and are disabled by default.
- nghttp2: drop `$HOME/build` (does not exist)

Closes #15887
2025-01-01 14:28:38 +01:00
Daniel Stenberg
150b0d808b
urlapi: cleanup the redirect logic somewhat
Closes #15877
2025-01-01 14:11:15 +01:00
Viktor Szakats
07a084f539
lib: remove __EMX__ guards
Follow-up to 179ee78e86 #2166
Closes #15884
2025-01-01 12:44:20 +01:00
Viktor Szakats
70b49a4e4c
file: fix Android compiler warning
Apply the fix already used in `lib/fopen.c`.

```
lib/file.c:326:41: warning: implicit conversion loses integer precision: 'unsigned int' to 'mode_t' (aka 'unsigned short') [-Wimplicit-int-conversion]
  326 |   fd = open(file->path, mode, data->set.new_file_perms);
      |        ~~~~                   ~~~~~~~~~~^~~~~~~~~~~~~~
```

Closes #15883
2025-01-01 12:44:20 +01:00
Viktor Szakats
5054c68b58
file: drop OPEN_NEEDS_ARG3 option
Not set since 1bf3643f7b #8362 (2022)
Added in 00883822be (2009) for VxWorks.

Closes #15882
2025-01-01 12:44:20 +01:00
Viktor Szakats
98932f3487
multissl: auto-enable OPENSSL_COEXIST for wolfSSL + OpenSSL
When building with both OpenSSL and wolfSSL set this necessary option.
Otherwise fail with an error.

Requires wolfSSL v5.7.6 or upper.

Closes #15765
2025-01-01 06:20:30 +01:00
renovate[bot]
1019b410c9
CI: update dependency wolfSSL/wolfssl to v5.7.6
Closes #15886
2025-01-01 05:46:31 +01:00