Commit Graph

6273 Commits

Author SHA1 Message Date
Daniel Stenberg
7d8d25174c
docs/cmdline-opts: mention STARTTLS for --ssl and --ssl-reqd
... since users might look for those terms in the manpage.

Closes #13590
2024-05-12 17:39:20 +02:00
Viktor Szakats
5b9955e0bd
examples: fix/silence -Wsign-conversion
- extend `FD_SET()` hack to all platforms (was only Cygwin).
  Warnings may also happen in other envs, e.g. OmniOS.
  Ref: https://github.com/libssh2/libssh2/actions/runs/8854199687/job/24316762831#step:3:2021

- tidy-up `CURLcode` vs `int` use.

- cast an unsigned to `long` before passing to `curl_easy_setopt()`.

Cherry-picked from #13489
Follow-up to 3829759bd0 #12489
Closes #13501
2024-05-11 11:11:32 +02:00
Jay Satiro
798a37b25e lib: clear the easy handle's saved errno before transfer
- Clear data->state.os_errno before transfer.

- Explain the change in behavior in the CURLINFO_OS_ERRNO doc.

- Add to the CURLINFO_OS_ERRNO doc the list of libcurl network-related
  errors that may cause the errno to be saved.

data->state.os_errno is saved before libcurl returns a network-related
failure such as connection failure. It is accessible to the user via
CURLINFO_OS_ERRNO so they can get more information about the failure.

Prior to this change it wasn't cleared before transfer, so if a user
retrieved the saved errno it could be from a previous transfer. That is
because an errno is not always saved for network-related errors.

Closes https://github.com/curl/curl/pull/13574
2024-05-10 18:26:32 -04:00
Stefan Eissing
b7c7dffe35
ftp: add tracing support
- add `Curl_trc_feat_ftp` for tracing via trace config
- add macro CURL_TRC_FTP(data, fmt, ...)
- replace DEBUGF(infof()) statements in ftp.c by CURL_TRC_FTP()
- always trace FTP connection state

Closes #13580
2024-05-10 23:39:48 +02:00
Jay Satiro
edc5b3502c docs: fix some CURLINFO examples
- improve getinfo result check for example sections:
  CURLINFO_ACTIVESOCKET, CURLINFO_LASTSOCKET, CURLINFO_SSL_VERIFYRESULT,
  CURLINFO_PROXY_SSL_VERIFYRESULT

- fix getinfo result check for example sections:
  CURLINFO_NUM_CONNECTS, CURLINFO_OS_ERRNO

- fix verify result check for example sections:
  CURLINFO_PROXY_SSL_VERIFYRESULT

Bug: https://github.com/curl/curl/discussions/13557#discussion-6625507
Reported-by: farazrbx@users.noreply.github.com

Closes https://github.com/curl/curl/pull/13559
2024-05-10 01:12:36 -04:00
Daniel Stenberg
3b4b6bd1df
KNOWN_BUGS: gssapi library name + version is missing in curl_version_info()
Closes #13492
Closes #13570
2024-05-09 12:04:19 +02:00
Daniel Stenberg
c294f9cb56
lib: make protocol handlers store scheme name lowercase
- saves a lowercase operation when the "[scheme]_proxy" name is
  generated
- appears less "shouting"
- update test 970, 972, 1438 and 1536

Closes #13553
2024-05-08 09:39:30 +02:00
Daniel Gustafsson
46d7214ca9 tls: Remove EXAMPLEs from deprecated options
CURLOPT_EGDSOCKET and CURLOPT_RANDOM_FILE are both completely dead
so remove their example sections since the code there is useless.
There is still a way to inject a random file for OpenSSL older than
1.1.0 but it's not what the example showed (and it's not even done
with this option) so we refrain from documenting it here.

Closes: #13540
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2024-05-06 20:55:27 +02:00
Daniel Stenberg
7490d5488e
EXPERIMENTAL: add graduation requirements for each feature
Starting now, experimental features should have a set of documentated
requirements of what is needed for the feature to graduate.

This adds requirements to all existing experiments.

Closes #13541
2024-05-06 17:05:04 +02:00
Ivan
a74f4d9518 misc: fix typos, quoting and spelling
Fix wording of comments, and misquotings where `' is markdown parsed
where it shouldn't be, and remove a misspelled preprocessor comment
which really isn't needed (and removing it makes it match surrounding
code better).

Closes: #13538
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2024-05-06 10:35:53 +02:00
Viktor Szakats
b6305011ec
DISTROS: add patch and issues link for curl-for-win
curl-for-win sometimes includes curl patches that were already merged in
master, but not yet part of a stable release.

Also include the Issues link. Build-specific issues are handled there.

Ref: #13493
Closes #13499
2024-04-29 16:45:58 +02:00
Stefan Eissing
b06619d0a3
tests: add SNI and peer name checks
- connect to DNS names with trailing dot
- connect to DNS names with double trailing dot
- rustls, always give `peer->hostname` and let it
  figure out SNI itself
- add SNI tests for ip address and localhost
- document in code and TODO that QUIC with ngtcp2+wolfssl
  does not do proper peer verification of the certificate
- mbedtls, skip tests with ip address verification as not
  supported by the library

Closes #13486
2024-04-29 08:20:35 +02:00
Daniel Stenberg
c04664ad35
curl_getdate.md: document two-digit year handling
Mentioned-by: Paul Gilmartin
Ref: https://curl.se/mail/archive-2024-04/0014.html
Closes #13494
2024-04-29 08:16:20 +02:00
Viktor Szakats
dfdd978f7c
cmake: add BUILD_EXAMPLES option to build examples
You can enable it with `-DBUILD_EXAMPLES=ON`.

To match autotools' `make examples` feature.
Windows (static) builds not tested.

Also enable examples in a pair of CI jobs.

Apply related updates to the macOS CI workflow:
- drop unused `CXX` envs.
- drop no longer needed `-Wno-error=undef -Wno-error=conversion` flags.
- pass `-Wno-deprecated-declarations` to GCC too (for `BUILD_EXAMPLES`).
- document why `-Wno-deprecated-declarations` is necessary.

Closes #13491
2024-04-29 00:26:50 +02:00
Jan Venekamp
fba9afebba
mbedTLS: implement CURLOPT_SSL_CIPHER_LIST option
Use a lookup list to set the cipher suites, allowing the
ciphers to be set by either openssl or IANA names.

To keep the binary size of the lookup list down we compress
each entry in the cipher list down to 2 + 6 bytes using the
C preprocessor.

Closes #13442
2024-04-24 14:30:37 +02:00
Jay Satiro
7860f575fe dllmain: Call OpenSSL thread cleanup for Windows and Cygwin
- Call OPENSSL_thread_stop on thread termination (DLL_THREAD_DETACH)
  to prevent a memory leak in case OpenSSL is linked statically.

- Warn in libcurl-thread.3 that if OpenSSL is linked statically then it
  may require thread cleanup.

OpenSSL may need per-thread cleanup to stop a memory leak. For Windows
and Cygwin if libcurl was built as a DLL then we can do that for the
user by calling OPENSSL_thread_stop on thread termination. However, if
libcurl was built statically then we do not have notification of thread
termination and cannot do that for the user.

Also, there are several other unusual cases where it may be necessary
for the user to call OPENSSL_thread_stop, so in the libcurl-thread
warning I added a link to the OpenSSL documentation.

Co-authored-by: Viktor Szakats

Reported-by: southernedge@users.noreply.github.com
Reported-by: zmcx16@users.noreply.github.com

Ref: https://www.openssl.org/docs/man3.0/man3/OPENSSL_thread_stop.html#NOTES

Fixes https://github.com/curl/curl/issues/12327
Closes https://github.com/curl/curl/pull/12408
2024-04-24 04:04:25 -04:00
Jan Venekamp
3b8db84c1b
rustls: remove incorrect SSLSUPP_TLS13_CIPHERSUITES flag
The rustls backend advertises SSLSUPP_TLS13_CIPHERSUITES, but
the code does not actually seem to support it (yet?). Removed
the flag and corrected documentation.

Closes #13452
2024-04-24 08:59:14 +02:00
Daniel Stenberg
229c144fe8
curl_url_get.md: clarify queries and fragments and CURLU_GET_EMPTY
Follow-up to 3eac21d86b

Closes #13407
2024-04-18 16:13:34 +02:00
Daniel Stenberg
1634330474
curl_url_set.md: extended
Closes #13404
2024-04-18 11:10:46 +02:00
Daniel Stenberg
3eac21d86b
urlapi: add CURLU_GET_EMPTY for empty queries and fragments
By default the API inhibits empty queries and fragments extracted.
Unless this new flag is set.

This also makes the behavior more consistent: without it set, zero
length queries and fragments are considered not present in the URL. With
the flag set, they are returned as a zero length strings if they were in
fact present in the URL.

This applies when extracting the individual query and fragment
components and for the full URL.

Closes #13396
2024-04-18 10:37:28 +02:00
Daniel Stenberg
c03556fb18
ROADMAP: remove completed entries, mention websocket 2024-04-17 10:35:12 +02:00
Daniel Stenberg
c2372e2a15
THANKS-filter: name fixes 2024-04-17 09:48:45 +02:00
MonkeybreadSoftware
add22feeef
idn: add native AppleIDN (icucore) support for macOS/iOS
I implemented the IDN functions for macOS and iOS using Unicode
libraries coming with macOS and iOS.

Builds and runs here on macOS 14.2.1. Also verified to load and
run on older macOS version 10.13.

Build requires macOS SDK 13 or equivalent.

Set `-DUSE_APPLE_IDN=ON` CMake option to enable it.
With autotools and other build tools, set these manual options:
```
CPPFLAGS=-DUSE_APPLE_IDN
LIBS=-licucore
```

Completes TODO 1.6.

TODO: add autotools option and feature-detection.

Refs: #5330 #5371
Co-authored-by: Viktor Szakats
Closes #13246
2024-04-17 00:24:09 +02:00
Daniel Stenberg
d28f74913c
dmaketgz: release tarball generation using docker
For easier reproducibility.

Mention using this script in RELEASE-PROCEDURE

Closes #13388
2024-04-16 23:38:55 +02:00
Viktor Szakats
5d3016adf7
dist: add ECH files to tarball
Also sort `EXTRA_DIST` list in `tests/Makefile.am` and make it diffable.

Follow-up to a362962b72 #11922
Closes #13381
2024-04-16 19:47:13 +02:00
Daniel Stenberg
5e3fd347c5
version: add "ECH" as a feature
If available

Follow-up to a362962b7
Closes #13378
2024-04-16 13:24:08 +02:00
Daniel Stenberg
a1ecd0ba6b
CURLOPT_ECH: polish
- remove the pointer to build instructions, it won't work in manpages
- add see-also
- minor white space edits

Closes #13379
2024-04-16 09:58:45 +02:00
Viktor Szakats
f81f60206d
tidy-up: whitespace [ci skip] 2024-04-16 09:53:39 +02:00
Stephen Farrell
a362962b72
TLS: add support for ECH (Encrypted Client Hello)
An EXPERIMENTAL feature used with CURLOPT_ECH and --ech.

Closes #11922
2024-04-16 08:10:53 +02:00
Daniel Stenberg
565d28dc8e
RELEASE-NOTES: synced 2024-04-15 23:47:08 +02:00
Daniel Stenberg
dde4b3855e
curl_version_info: provide librtmp version
Ref: https://github.com/curl/curl/pull/13364#issuecomment-2054151942
Reported-by: talregev on github
Closes #13368
2024-04-15 16:48:34 +02:00
blankie
e1f1ec028a
docs: clarify CURLOPT_MAXFILESIZE and CURLOPT_MAXFILESIZE_LARGE
The bounds of the size parameter were not specified, and nor was it
specified how to disable the maximum file size check.

The documentation also incorrectly stated that CURLOPT_MAXFILESIZE
always returns CURLE_OK and that CURLOPT_MAXFILESIZE_LARGE only returns
CURLE_OK or CURLE_UNKNOWN_OPTION.

It also did not mention what the default value is, which is zero. This
commit updates the documentation to make note of all these things.

Closes #13372
2024-04-15 13:38:27 +02:00
Dan Fandrich
de66e8ad38 DISTROS: mark rolling release distros
These are ones that are unlikely to have back-ported curl patches.

Closes #13353
2024-04-12 11:28:24 -07:00
Viktor Szakats
0a4419ae4c
dist: add files missing from release tarball
Closes #13346
2024-04-11 15:52:08 +00:00
Toon Claes
0f7be5a519
docs: add CURLOPT_NOPROGRESS to CURLOPT_XFERINFOFUNCTION example
It's important to set `CURLOPT_NOPROGRESS` to `0` if you want your
transfer callback function, set by `CURLOPT_XFERINFOFUNCTION`, getting
called. To emphasize this to the users, add this to the code example.

Closes #13348
2024-04-11 15:59:53 +02:00
RainRat
1087937992
misc: fix typos
Closes #13344
2024-04-11 15:44:22 +02:00
Colin Leroy-Mira
bfe54b0e88
file: add support for getting basic directory listings
Not supported on Windows (yet)

Closes #13137
2024-04-11 12:37:12 +02:00
Viktor Szakats
3d569aaaf8
cmake: use namespaced custom target names
Rename custom target to namespaced (unique) names to avoid colliding
with 3rd-party projects (e.g. libzip) built together with curl.

Reported-by: hammlee96 on github
Fixes #13324
Closes #13326
2024-04-09 21:20:54 +00:00
Daniel Stenberg
187b23b0a4
curl_multi_waitfds.md: add protocol mention
Follow-up to 02beac6bb6
2024-04-09 16:59:28 +02:00
Dmitry Karpov
02beac6bb6
lib: add curl_multi_waitfds
New function call, similar to curl_multi_fdset()

Closes #13135
2024-04-09 16:53:40 +02:00
Daniel Stenberg
50def7c881
NTLM_WB: drop support
The feature has not worked for months and has been marked as DEPRECATED
for six+ months.

Closes #13249
2024-04-08 13:58:58 +02:00
Daniel Stenberg
bcc2e90e45
docs/cmdline-opts: invoke managen using a relative path
... no need to use an absolute path, that makes the build unncessarily
fail if invoked using a different mount point. managen now takes options
to find the input files.

Update test1478 to provide the dir arguments to managen

Closes #13281
2024-04-08 10:27:27 +02:00
Daniel Stenberg
995b42eb33
DISTROS: Cygwin updates
Brought-by: Brian Inglis
Fixes #13258
Co-authored-by: Viktor Szakats
Closes #13279
2024-04-05 16:09:15 +02:00
Stefan Eissing
0b28ece657
lib: add trace support for client reads and writes
- add `CURL_TRC_READ()` and `CURL_TRC_WRITE()`
- use in generic client writers and readers, as well
  as http headers, chunking and websockets

Closes #13223
2024-04-05 16:08:10 +02:00
Viktor Szakats
2cac6a49b3
cmake: fixup DEPENDS filename
Fixing:
```
make[2]: Circular docs/curl-config.1 <- docs/curl-config.1 dependency dropped.
make[2]: Circular docs/mk-ca-bundle.1 <- docs/mk-ca-bundle.1 dependency dropped.
```
Ref: https://github.com/curl/curl/actions/runs/8559617487/job/23456740844?pr=13282#step:6:18

Follow-up to 5023ffad2c #13197
Closes #13283
2024-04-04 22:58:51 +00:00
Viktor Szakats
bb84f82476
cmake: speed up libcurl doc building again
This time limit the number of files per command to avoid exceeding
limitations of certain OS/shell envs.

Such known env is Windows with the `cmd.exe` shell, which features an
8K command-line length limit to this day.

Allowlisting `UNIX` to have no limit and using a limit of 200 for other
envs to be safe. If there is a way to detect `cmd.exe` and/or we know
which precise envs are sensitive to this, we can tweak these conditions
further.

Even with the low limit, this patch reduces external commands by 200x,
making builds much faster.

Ref: #12762 2620aa930b (initial)
Ref: #13047 f03c85635f (revert)

Reviewed-by: Daniel Stenberg
Closes #13207
2024-04-04 09:21:17 +00:00
Viktor Szakats
19f4263f26
cmake: tidy-up to use WORKING_DIRECTORY
Reviewed-by: Daniel Stenberg
Closes #13206
2024-04-04 09:21:17 +00:00
Viktor Szakats
5023ffad2c
cmake: generate misc manpages and install mk-ca-bundle.pl
- install `mk-ca-bundle.pl` like autotools does.

- generate and install `mk-ca-bundle.1` and `curl-config.1` like
  autotools. This fixes tests 1140 and 1173.

  Reported-by: Dan Fandrich
  Fixes #13194

- add option `BUILD_MISC_DOCS` to control building the above two
  manpages. Enabled by default.

- appveyor: stop disabling tests 1140 and 1173.

Reviewed-by: Daniel Stenberg
Closes #13197
2024-04-04 09:20:04 +00:00
Daniel Stenberg
60971d665b
dist: remove the curl-config.1 from the tarball
The markdown file is already there and the .1 file gets generated in the
build.

Ref: #13250
Closes #13268
2024-04-03 13:16:39 +02:00
Daniel Stenberg
df3d5ef25e
curl_global_trace.md: shorten the description
Closes #13263
2024-04-02 23:39:39 +02:00