Commit Graph

2188 Commits

Author SHA1 Message Date
Viktor Szakats
75087c3baa
misc: fix typos
Closes #10706
2023-03-08 08:00:35 +00:00
Daniel Stenberg
2a31086f39
docs: extend the URL API descriptions
Closes #10701
2023-03-07 13:36:10 +01:00
Brad Spencer
ad4997e5b2
urlapi: parse IPv6 literals without ENABLE_IPV6
This makes the URL parser API stable and working the same way
independently of libcurl supporting IPv6 transfers or not.

Closes #10660
2023-03-03 10:05:08 +01:00
Daniel Stenberg
26c6d822bc
libcurl-errors.3: add the CURLHcode errors from curl_easy_header.3
Closes #10629
2023-02-28 08:21:34 +01:00
Pierrick Charron
cffe301299
CURLOPT_WS_OPTIONS.3: fix the availability version
Closes #10557
2023-02-18 23:45:14 +01:00
Daniel Stenberg
1695fcf57d
man pages: call the custom user pointer 'clientp' consistently
The variable had a few different names. Now try to use 'clientp'
consistently for all man pages using a custom pointer set by the
application.

Reported-by: Gerrit Renker

Fixes #10434
Closes #10435
2023-02-07 22:33:47 +01:00
Daniel Stenberg
ff7c390b29
curl_ws_send.3: clarify how to send multi-frame messages 2023-02-06 17:27:51 +01:00
Thomas1664
c29ccb35ff
CURLOPT_WRITEFUNCTION.3: fix memory leak in example
Closes #10390
2023-02-03 10:02:47 +01:00
Thomas1664 on github
72d4f7d8f7
curl_free.3: fix return type of curl_free
Fixes #10373
Closes #10374
2023-01-31 08:32:37 +01:00
Daniel Stenberg
ee51f5847a
CURLOPT_READFUNCTION.3: the callback 'size' arg is always 1
Reported-by: Brian Green
Fixes #10328
Closes #10355
2023-01-29 10:28:17 +01:00
Dan Fandrich
5a70403cff docs: POSTFIELDSIZE must be set to -1 with read function
Reported-by: RanBarLavie on github

Closes #10313
2023-01-20 10:01:43 -08:00
Sergey Bronnikov
de07d804fb curl_version_info.3: fix typo
Closes https://github.com/curl/curl/pull/10306
2023-01-17 03:37:38 -05:00
Jay Satiro
c4cd0e2be9 openssl: Don't ignore CA paths when using Windows CA store (redux)
.. and remove 'experimental' designation from CURLSSLOPT_NATIVE_CA.

This commit restores the behavior of CURLSSLOPT_NATIVE_CA so that it
does not override CURLOPT_CAINFO / CURLOPT_CAPATH, or the hardcoded
default locations. Instead the native Windows CA store can be used at
the same time.

---

This behavior was originally added over two years ago in abbc5d60
(#5585) but then 83393b1a (#7892) broke it over a year ago, I assume
inadvertently.

The CURLSSLOPT_NATIVE_CA feature was marked experimental and likely
rarely used.

Ref: https://github.com/curl/curl/pull/5585
Ref: https://github.com/curl/curl/pull/7892
Ref: https://curl.se/mail/lib-2023-01/0019.html

Closes https://github.com/curl/curl/pull/10244
2023-01-17 03:32:58 -05:00
Daniel Stenberg
a56d2b0b94
curl.h: add CURL_HTTP_VERSION_3ONLY
As the previous CURL_HTTP_VERSION_3 option gets a slightly altered meaning.

Closes #10264
2023-01-12 16:17:55 +01:00
Daniel Stenberg
5cb63da771
curl.h: allow up to 10M buffer size
Bump the limit from 512K. There might be reasons for applications using
h3 to set larger buffers and there is no strong reason for curl to have
a very small maximum.

Ref: https://curl.se/mail/lib-2023-01/0026.html

Closes #10256
2023-01-08 20:54:48 +01:00
Jay Satiro
d7b56ac75c CURLOPT_HEADERDATA.3: warn DLL users must set write function
- Warn that in Windows if libcurl is running from a DLL and if
  CURLOPT_HEADERDATA is set then CURLOPT_WRITEFUNCTION or
  CURLOPT_HEADERFUNCTION must be set as well, otherwise the user may
  experience crashes.

We already have a similar warning in CURLOPT_WRITEDATA. Basically, in
Windows libcurl could crash writing a FILE pointer that was created by
a different C runtime. In Windows each DLL that is part of a program may
or may not have its own C runtime.

Ref: https://github.com/curl/curl/issues/10231

Closes https://github.com/curl/curl/pull/10233
2023-01-06 03:45:17 -05:00
Daniel Stenberg
2bc1d775f5
copyright: update all copyright lines and remove year ranges
- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205
2023-01-03 09:19:21 +01:00
Daniel Stenberg
afd0a12f8b
curl_global_sslset.3: clarify the openssl situation
and add rustls

Closes #10188
2023-01-01 15:08:06 +01:00
Daniel Stenberg
17f0891184
docs/libcurl/curl_getdate.3: minor whitespace edit
To avoid a fccp quirk that made it render wrongly on the website
2022-12-30 12:58:14 +01:00
Daniel Stenberg
076a2f6291
share: add sharing of HSTS cache among handles
Closes #10138
2022-12-27 15:22:01 +01:00
Daniel Stenberg
901392cbb7
urlapi: add CURLU_PUNYCODE
Allows curl_url_get() get the punycode version of host names for the
host name and URL parts.

Extend test 1560 to verify.

Closes #10109
2022-12-26 23:29:23 +01:00
Daniel Stenberg
ee583c68d4
docs: mention indirect effects of --insecure
Warn users that disabling certficate verification allows servers to
"pollute" curl with data it trusts.

Reported-by: Harry Sintonen
Closes #10126
2022-12-21 23:36:58 +01:00
Daniel Stenberg
46441955bf
CURLOPT_DEBUGFUNCTION.3: emphasize that incoming data is "raw"
Closes #10106
2022-12-16 15:02:38 +01:00
Daniel Stenberg
6f40703ba0
curl_url_get.3: remove spurious backtick
Put there by mistake.

Follow-up from 9a8564a92

Closes #10101
2022-12-15 15:56:26 +01:00
Daniel Stenberg
af0924210b
curl_url_set.3: document CURLU_DISALLOW_USER
Closes #10099
2022-12-15 12:38:57 +01:00
Emil Engler
a20f99de74 curl_url_set.3: fix typo
Closes: #10089
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2022-12-13 20:29:37 +01:00
Daniel Stenberg
734c1f8909
ws: if no connection is around, return error
- curl_ws_send returns CURLE_SEND_ERROR if data->conn is gone

- curl_ws_recv returns CURLE_GOT_NOTHING on connection close

- curl_ws_recv.3: mention new return code for connection close + example
  embryo

Closes #10084
2022-12-13 15:13:03 +01:00
MonkeybreadSoftware
1a88b6b653 docs/curl_ws_send: Fixed typo in websocket docs
Replace as with is in relevant sentences.

Closes: #10081
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2022-12-11 20:52:12 +01:00
Daniel Stenberg
f0b374f662
KNOWN_BUGS: remove items not considered bugs any more
- CURL_GLOBAL_SSL

This option was changed in libcurl 7.57.0 and clearly it has not caused
too many issues and a lot of time has passed.

- Store TLS context per transfer instead of per connection

This is a possible future optimization. One that is much less important
and interesting since the added support for CA caching.

- Microsoft telnet server

This bug was filed in May 2007 against curl 7.16.1 and we have not
received further reports.

- active FTP over a SOCKS

Actually, proxies in general is not working with active FTP mode. This
is now added in proxy documentation.

- DICT responses show the underlying protocol

curl still does this, but since this is now an established behavior
since forever we cannot change it easily and adding an option for it
seems crazy as this protocol is not so little its not worth it. Let's
just live with it.

- Secure Transport disabling hostname validation also disables SNI

This is an already documented restriction in Secure Transport.

- CURLOPT_SEEKFUNCTION not called with CURLFORM_STREAM

The curl_formadd() function is marked and documented as deprecated. No
point in collecting bugs for it. It should not be used further.

- STARTTRANSFER time is wrong for HTTP POSTs

After close source code inspection I cannot see how this is true or that
there is any special treatment for different HTTP methods. We also have
not received many further reports on this, making me strongly suspect
that this is no (longer an) issue.

- multipart formposts file name encoding

The once proposed RFC 5987-encoding is since RFC 7578 documented as MUST
NOT be used. The since then implemented MIME API allows the user to set
the name on their own and can thus provide it encoded as it wants.

- DoH is not used for all name resolves when enabled

It is questionable if users actually want to use DoH for interface and
FTP port name resolving. This restriction is now documented and we
advice users against using name resolving at all for these functions.

Closes #10043
2022-12-09 13:55:01 +01:00
Daniel Stenberg
da8e215f6c
CURLOPT_COOKIEFILE.3: advice => advise
Closes #10063

Reviewed-by: Daniel Gustafsson
2022-12-09 10:51:44 +01:00
Patrick Monnerat
eb559c8056
mime: relax easy/mime structures binding
Deprecation and removal of codeset conversion support from the library
have released the strict need for an early binding of mime structures to
an easy handle (https://github.com/curl/curl/commit/2610142).

This constraint currently forces to create the handle before the mime
structure and the latter cannot be attached to another handle once
created (see https://curl.se/mail/lib-2022-08/0027.html).

This commit removes the handle pointers from the mime structures
allowing more flexibility on their use.

When an easy handle is duplicated, bound mime structures must however
still be duplicated too as their components hold send-time dynamic
information.

Closes #9927
2022-11-28 09:09:54 +01:00
Daniel Stenberg
3e33681eaf
KNOWN_BUGS: remove five FTP related issues
- "FTP with CONNECT and slow server"

I believe this is not a problem these days.

- "FTP with NULs in URL parts"

The FTP protocol does not support them properly anyway.

- remove "FTP and empty path parts in the URL"

I don't think this has ever been reported as a real problem but was only
a hypothetical one.

- "Premature transfer end but healthy control channel"

This is not a bug, this is an optimization that *could* be performed but is
not an actual problem.

- "FTP without or slow 220 response"

Instead add to the documentation of the connect timeout that the
connection is considered complete at TCP/TLS/QUIC layer.

Closes #9979
2022-11-26 12:33:58 +01:00
Casey Bodley
7f8e6da6dc
aws_sigv4: consult x-%s-content-sha256 for payload hash
`Curl_output_aws_sigv4()` doesn't always have the whole payload in
memory to generate a real payload hash. this commit allows the user to
pass in a header like `x-amz-content-sha256` to provide their desired
payload hash

some services like s3 require this header, and may support other values
like s3's `UNSIGNED-PAYLOAD` and `STREAMING-AWS4-HMAC-SHA256-PAYLOAD`
with special semantics. servers use this header's value as the payload
hash during signature validation, so it must match what the client uses
to generate the signature

CURLOPT_AWS_SIGV4.3 now describes the content-sha256 interaction

Signed-off-by: Casey Bodley <cbodley@redhat.com>

Closes #9804
2022-11-25 09:24:07 +01:00
Daniel Stenberg
66ca8ace1a
docs: add more "SEE ALSO" links to CA related pages
Closes #9959
2022-11-22 14:43:38 +01:00
Jay Satiro
e08382a208 CURLOPT_POST.3: Explain setting to 0 changes request type
Bug: https://github.com/curl/curl/issues/9849
Reported-by:  MonkeybreadSoftware@users.noreply.github.com

Closes https://github.com/curl/curl/pull/9942
2022-11-19 03:19:32 -05:00
Alexandre Ferrieux
49798cac83
CURLOPT_QUICK_EXIT: don't wait for DNS thread on exit
Fixes #2975
Closes #9147
2022-11-18 00:17:27 +01:00
Patrick Monnerat
6967571bf2
lib: feature deprecation warnings in gcc >= 4.3
Add a deprecated attribute to functions and enum values that should not
be used anymore.
This uses a gcc 4.3 dialect, thus is only available for this version of
gcc and newer. Note that the _Pragma() keyword is introduced by C99, but
is available as part of the gcc dialect even when compiling in C89 mode.

It is still possible to disable deprecation at a calling module compile
time by defining CURL_DISABLE_DEPRECATION.

Gcc type checking macros are made aware of possible deprecations.

Some testing support Perl programs are adapted to the extended
declaration syntax.

Several test and unit test C programs intentionally use deprecated
functions/options and are annotated to not generate a warning.

New test 1222 checks the deprecation status in doc and header files.

Closes #9667
2022-11-15 10:57:29 +01:00
Patrick Monnerat
e1e482517f
docs: curl_version_info is not thread-safe before libcurl initialization
Closes #9583
2022-11-14 09:19:06 +01:00
Patrick Monnerat
e780aae77a
version: add a feature names array to curl_version_info_data
Field feature_names contains a null-terminated sorted array of feature
names. Bitmask field features is deprecated.

Documentation is updated. Test 1177 and tests/version-scan.pl updated to
match new documentation format and extended to check feature names too.

Closes #9583
2022-11-14 09:18:53 +01:00
Jay Satiro
6d75115406 lib: add CURL_WRITEFUNC_ERROR to signal write callback error
Prior to this change if the user wanted to signal an error from their
write callbacks they would have to use logic to return a value different
from the number of bytes (nmemb) passed to the callback. Also, the
inclination of some users has been to just return 0 to signal error,
which is incorrect as that may be the number of bytes passed to the
callback.

To remedy this the user can now return CURL_WRITEFUNC_ERROR instead.

Ref: https://github.com/curl/curl/issues/9873

Closes https://github.com/curl/curl/pull/9874
2022-11-10 03:13:58 -05:00
Michael Drake
1fdca35ddd
curl.h: add CURLOPT_CA_CACHE_TIMEOUT option
Adds a new option to control the maximum time that a cached
certificate store may be retained for.

Currently only the OpenSSL backend implements support for
caching certificate stores.

Closes #9620
2022-11-08 10:06:12 +01:00
Daniel Stenberg
ec4eec222b
CURLOPT_DEBUGFUNCTION.3: do not assume nul-termination in example
Reported-by: Oskar Sigvardsson

Bug: https://curl.se/mail/lib-2022-11/0016.html

Closes #9862
2022-11-07 12:48:39 +01:00
Daniel Stenberg
b1953c1933
noproxy: tailmatch like in 7.85.0 and earlier
A regfression in 7.86.0 (via 1e9a538e05) made the tailmatch work
differently than before. This restores the logic to how it used to work:

All names listed in NO_PROXY are tailmatched against the used domain
name, if the lengths are identical it needs a full match.

Update the docs, update test 1614.

Reported-by: Stuart Henderson
Fixes #9842
Closes #9858
2022-11-07 08:00:38 +01:00
Adam Averay
84e2ca7e3c
libcurl-errors.3: remove duplicate word
Closes #9846
2022-11-03 09:34:03 +01:00
Patrick Schlangen
b8c302dcba
docs: remove performance note in CURLOPT_SSL_VERIFYPEER
This note became obsolete since PR #7892 (see also discussion in the PR
comments).

Closes #9832
2022-10-30 22:26:24 +01:00
Daniel Stenberg
d4fed2a13a
docs: explain the noproxy CIDR notation support
Follow-up to 1e9a538e05

Closes #9818
2022-10-28 09:02:22 +02:00
Daniel Stenberg
716ad5ea49
CURLMOPT_SOCKETFUNCTION.3: clarify CURL_POLL_REMOVE
The removal is brief or long, don't assume.

Reported-by: Luca Niccoli

Fixes #9799
Closes #9800
2022-10-26 11:23:35 +02:00
Daniel Stenberg
873cc38e89
docs: make sure libcurl opts examples pass in long arguments
Reported-by: Sergey
Fixes #9779
Closes #9780
2022-10-22 23:24:57 +02:00
Daniel Stenberg
1e9a538e05
noproxy: support proxies specified using cidr notation
For both IPv4 and IPv6 addresses. Now also checks IPv6 addresses "correctly"
and not with string comparisons.

Split out the noproxy checks and functionality into noproxy.c

Added unit test 1614 to verify checking functions.

Reported-by: Mathieu Carbonneaux

Fixes #9773
Fixes #5745
Closes #9775
2022-10-21 13:39:20 +02:00
Brad Harder
6a7c776ee6
CURLMOPT_PIPELINING.3: dedup manpage xref
Closes #9776
2022-10-20 23:17:00 +02:00
Daniel Stenberg
40f3504401
CURLOPT_AUTOREFERER.3: highlight the privacy leak risk
Closes #9757
2022-10-18 16:04:12 +02:00
Daniel Stenberg
d345ebfcda
CURLOPT_POSTFIELDS.3: refer to CURLOPT_MIMEPOST
Not the deprecated CURLOPT_HTTPPOST option.

Also added two see-alsos.

Reported-by: Trail of Bits
Closes #9752
2022-10-17 16:09:22 +02:00
Patrick Monnerat
b0e4ebe960
doc: fix deprecation versions inconsistencies
Ref: https://curl.se/mail/lib-2022-10/0026.html

Closes #9711
2022-10-13 13:59:56 +02:00
12932
ddeec8feba
misc: nitpick grammar in comments/docs
because the 'u' in URL is actually a consonant *sound* it is only
correct to write "a URL"

sorry this is a bit nitpicky :P

https://english.stackexchange.com/questions/152/when-should-i-use-a-vs-an
https://www.techtarget.com/whatis/feature/Which-is-correct-a-URL-or-an-URL

Closes #9699
2022-10-12 11:32:43 +02:00
Martin Ågren
c96462addc
docs: fix grammar around needing pass phrase
"You never needed a pass phrase" reads like it's about to be followed by
something like "until version so-and-so", but that is not what is
intended. Change to "You never need a pass phrase". There are two
instances of this text, so make sure to update both.
2022-10-11 08:05:26 +02:00
Daniel Stenberg
642404717c
curl_ws_send.3: call the argument 'fragsize'
Since WebSocket works with "fragments" not "frames"

Closes #9668
2022-10-07 18:34:01 +02:00
Daniel Stenberg
e3f335148a
websockets: remodeled API to support 63 bit frame sizes
curl_ws_recv() now receives data to fill up the provided buffer, but can
return a partial fragment. The function now also get a pointer to a
curl_ws_frame struct with metadata that also mentions the offset and
total size of the fragment (of which you might be receiving a smaller
piece). This way, large incoming fragments will be "streamed" to the
application. When the curl_ws_frame struct field 'bytesleft' is 0, the
final fragment piece has been delivered.

curl_ws_recv() was also adjusted to work with a buffer size smaller than
the fragment size. (Possibly needless to say as the fragment size can
now be 63 bit large).

curl_ws_send() now supports sending a piece of a fragment, in a
streaming manner, in addition to sending the entire fragment in a single
call if it is small enough. To send a huge fragment, curl_ws_send() can
be used to send it in many small calls by first telling libcurl about
the total expected fragment size, and then send the payload in N number
of separate invokes and libcurl will stream those over the wire.

The struct curl_ws_meta() returns is now called 'curl_ws_frame' and it
has been extended with two new fields: *offset* and *bytesleft*. To help
describe the passed on data chunk when a fragment is delivered in many
smaller pieces.

The documentation has been updated accordingly.

Closes #9636
2022-10-07 12:50:58 +02:00
Daniel Stenberg
ea3ce80fa8
CURLOPT_COOKIEFILE: insist on "" for enable-without-file
The former way that also suggested using a non-existing file to just
enable the cookie engine could lead to developers maybe a bit carelessly
guessing a file name that will not exist, and then in a future due to
circumstances, such a file could be made to exist and then accidentally
libcurl would read cookies not actually meant to.

Reported-by: Trail of bits

Closes #9654
2022-10-06 10:17:31 +02:00
Jay Satiro
eada290098 CURLOPT_HTTPPOST.3: bolden the deprecation notice
Ref: https://github.com/curl/curl/pull/9621

Closes https://github.com/curl/curl/pull/9637
2022-10-05 18:41:55 -04:00
Daniel Stenberg
5299301a9b
CURLOPT_MIMEPOST.3: add an (inline) example
Reported-by: Jay Satiro
Bug: https://github.com/curl/curl/pull/9637#issuecomment-1268070723

Closes #9649
2022-10-05 16:04:08 +02:00
Daniel Stenberg
90ddfa465b
CURLOPT_COOKIELIST.3: fix formatting mistake
Also, updated manpage-syntax.pl to make it detect this error in test
1173.

Reported-by: ProceduralMan on github
Fixes #9639
Closes #9640
2022-10-04 11:59:55 +02:00
Daniel Stenberg
f77bde42d5
curl_url_set.3: document CURLU_APPENDQUERY proper
Listed among the other supported flags.

Reported-by: Robby Simpson
Fixes #9628
Closes #9629
2022-10-01 16:22:53 +02:00
Patrick Monnerat
2437fac013
lib: sanitize conditional exclusion around MIME
The introduction of CURL_DISABLE_MIME came with some additional bugs:
- Disabled MIME is compiled-in anyway if SMTP and/or IMAP is enabled.
- CURLOPT_MIMEPOST, CURLOPT_MIME_OPTIONS and CURLOPT_HTTPHEADER are
  conditioned on HTTP, although also needed for SMTP and IMAP MIME mail
  uploads.

In addition, the CURLOPT_HTTPHEADER and --header documentation does not
mention their use for MIME mail.

This commit fixes the problems above.

Closes #9610
2022-09-29 10:51:04 +02:00
Daniel Stenberg
ca3efd57c2
CURLSHOPT_UNLOCKFUNC.3: the callback as no 'access' argument
Probably a copy and paste error from the lock function man page.

Reported-by: Robby Simpson
Fixes #9612
Closes #9613
2022-09-28 23:18:54 +02:00
Daniel Stenberg
24ed4314b0
CURLOPT_ACCEPT_ENCODING.3: remove "four" as they are five
... instead just list the supported encodings.

Reported-by: ProceduralMan on github
Fixes #9614
Closes #9615
2022-09-28 23:17:51 +02:00
Daniel Stenberg
bf1571eb6f
docs: tag curl options better in man pages
As it makes them links in the HTML versions.

Verified by the extended test 1176
2022-09-22 17:36:28 +02:00
Daniel Stenberg
70b6c701f8
symbols-in-versions: CURLOPT_ENCODING is deprecated since 7.21.6 2022-09-22 17:35:23 +02:00
Daniel Stenberg
7295e62c66
curl.h: fix mention of wrong error code in comment
The same error and comment were also used and is now corrected in
CURLOPT_SSH_KEYFUNCTION.3
2022-09-22 09:43:39 +02:00
Daniel Stenberg
16814d8f8c
symbols-in-versions: add missing LIBCURL* symbols 2022-09-22 09:43:34 +02:00
Daniel Stenberg
4c8d180354
docs/libcurl/symbols-in-versions: add several missing symbols 2022-09-22 09:43:22 +02:00
Daniel Stenberg
fd1ce3d4b0
docs: spellfixes
Pointed by the new CI job
2022-09-21 15:20:08 +02:00
Tobias Schaefer
8e5b1b66c1
curl_strequal.3: fix typo
Closes #9548
2022-09-20 23:21:47 +02:00
Daniel Stenberg
fda897f5a1
docs: fix proselint complaints 2022-09-19 17:32:12 +02:00
Daniel Stenberg
307b7543ea
misc: null-terminate
Make use of this term consistently.

Closes #9527
2022-09-17 23:19:29 +02:00
Patrick Monnerat
5261efaed8
docs: tell about disabled protocols in CURLOPT_*PROTOCOLS_STR.
Disabled protocols are now handled as if they were unknown.
Also update the possible protocol list.
2022-09-16 23:29:09 +02:00
Sergey Bronnikov
62b8a4dd1c
curl_escape.3: fix typo
lengthf -> length

Closes #9517
2022-09-16 16:50:36 +02:00
Daniel Stenberg
dbaa1e17a6
CURLOPT_CONNECT_ONLY.3: for ws(s) as well
and correct the version number for when that support comes. Even if it
is still experimental for WebSocket.

Closes #9487
2022-09-13 10:31:48 +02:00
Daniel Stenberg
6a1bfbd11b
docs: use "WebSocket" in singular
This is how the RFC calls the protocol. Also rename the file in docs/ to
WEBSOCKET.md in uppercase to match how we have done it for many other
protocol docs in similar fashion.

Add the WebSocket docs to the tarball.

Closes #9496
2022-09-13 10:04:46 +02:00
Viktor Szakats
b62d236f7d
websockets: sync prototypes in docs with implementation [ci skip]
Docs for the new send/recv functions synced with the committed versions
of these.

Closes #9470
2022-09-10 21:37:53 +00:00
Daniel Stenberg
485c9ba50a
docs: the websockets symbols are added in 7.86.0
Nothing else

Closes #9459
2022-09-09 17:11:58 +02:00
Daniel Stenberg
eebfa3279d
curl_ws_meta: initial implementation 2022-09-09 15:11:14 +02:00
Daniel Stenberg
07cb887ed3
curl_ws_meta.3: added docs 2022-09-09 15:11:14 +02:00
Daniel Stenberg
664249d095
ws: initial websockets support
Closes #8995
2022-09-09 15:11:14 +02:00
Daniel Stenberg
fa26f15b19
CURLOPT_PROXY_SSLCERT_BLOB.3: this is for HTTPS proxies
The 'protocols' listed were previously wrong.

Reported-by: ProceduralMan on github
Fixes #9434
Closes #9435
2022-09-06 09:55:23 +02:00
Daniel Stenberg
5162ba0562
curl_easy_pause.3: unpausing is as fast as possible
Reported-by: ssdbest on github
Fixes #9410
Closes #9430
2022-09-05 17:34:49 +02:00
Daniel Stenberg
ad9383bd7d
CURLOPT_DNS_INTERFACE.3: mention it works for almost all protocols
Except file.

Reported-by: ProceduralMan on github
Fixes #9427
Closes #9428
2022-09-05 08:36:06 +02:00
Daniel Stenberg
472f1cbe7e
NPN: remove support for and use of
Next Protocol Negotiation is a TLS extension that was created and used
for agreeing to use the SPDY protocol (the precursor to HTTP/2) for
HTTPS. In the early days of HTTP/2, before the spec was finalized and
shipped, the protocol could be enabled using this extension with some
servers.

curl supports the NPN extension with some TLS backends since then, with
a command line option `--npn` and in libcurl with
`CURLOPT_SSL_ENABLE_NPN`.

HTTP/2 proper is made to use the ALPN (Application-Layer Protocol
Negotiation) extension and the NPN extension has no purposes
anymore. The HTTP/2 spec was published in May 2015.

Today, use of NPN in the wild should be extremely rare and most likely
totally extinct. Chrome removed NPN support in Chrome 51, shipped in
June 2016. Removed in Firefox 53, April 2017.

Closes #9307
2022-09-05 07:39:02 +02:00
Samuel Henrique
464ff5a610
manpages: Fix spelling of "allows to" -> "allows one to"
References:
 https://salsa.debian.org/lintian/lintian/-/blob/master/tags/t/typo-in-manual-page.tag
 https://english.stackexchange.com/questions/60271/grammatical-complements-for-allow/60285#60285

Closes #9419
2022-09-02 14:45:01 +02:00
Samuel Henrique
5c095a4435
CURLOPT_WILDCARDMATCH.3: Fix backslash escaping under single quotes
Lintian (on Debian) has been complaining about this for a while but
 I didn't bother initially as the groff parser that we use is not
 affected by this.

 But I have now noticed that the online manpage is affected by it:
 https://curl.se/libcurl/c/CURLOPT_WILDCARDMATCH.html

 (I'm using double quotes for quoting-only down below)

 The section that should be parsed as "'\'" ends up being parsed as
 "'´".

 This is due to roffit not parsing "'\\'" correctly, which is fine
 as the "correct" way of writing "'\'" is "'\e'" instead.

 Note that this fix is not enough to fix the online manpage at
 curl's website, as roffit seems to parse it wrongly either way.

 My intent is to at least fix the manpage so that roffit can
 be changed to parse "'\e'" correctly (although I suggest making
 roffit parse both ways correctly, since that's what groff does).

 More details at:
 https://bugs.debian.org/966803
 930b18e4b2/tags/a/acute-accent-in-manual-page.tag

Closes #9418
2022-09-02 14:43:32 +02:00
Daniel Stenberg
cf6e9ce80b
CURLOPT_BUFFERSIZE.3: add upload buffersize to see also
Closes #9354
2022-08-23 14:54:55 +02:00
Daniel Stenberg
20d083572a
curl_multi_perform.3: minor language fix
Closes #9316
2022-08-15 10:00:40 +02:00
Daniel Stenberg
b6dd849fa3
CURLINFO_SPEED_UPLOAD/DOWNLOAD.3: fix examples
Reported-by: jvvprasad78 on github
Assisted-by: Jay Satiro
Fixes #9239
Closes #9241
2022-08-07 14:25:55 +02:00
Daniel Stenberg
ba670b318c
CURLOPT_CONNECT_ONLY.3: clarify multi API use
Reported-by: Maxim Ivanov
Fixes #9244
Closes #9262
2022-08-07 14:07:23 +02:00
Wyatt O'Day
8beff43559 schannel: Add TLS 1.3 support
- Support TLS 1.3 as the default max TLS version for Windows Server 2022
  and Windows 11.

- Support specifying TLS 1.3 ciphers via existing option
  CURLOPT_TLS13_CIPHERS (tool: --tls13-ciphers).

Closes https://github.com/curl/curl/pull/8419
2022-08-02 13:54:31 -04:00
Daniel Stenberg
a88dbe410f
curl_multi_timeout.3: clarify usage
Fixes #9155
Closes #9157
Reported-by: jvvprasad78 on github
2022-07-17 23:27:55 +02:00
Jay Satiro
eab25898b3 docs: explain curl_easy_escape/unescape curl handle is ignored
26101421 (precedes 7.82.0) removed character conversion support used by
very old legacy operating systems and since then the curl handle passed
to curl_easy_escape/unescape is always ignored.

Bug: https://github.com/curl/curl/discussions/9115
Reported-by: Ted Lyngmo

Closes https://github.com/curl/curl/pull/9121
2022-07-10 02:59:58 -04:00
Daniel Stenberg
be43dd600a
CURLOPT_SERVER_RESPONSE_TIMEOUT: the new name
Starting now, CURLOPT_FTP_RESPONSE_TIMEOUT is the alias instead of the
other way around.

Since 7.20.0, CURLOPT_SERVER_RESPONSE_TIMEOUT has existed as an alias
but since the option is for more protocols than FTP the more "correct"
version of the option is the "server" one so now we switch.

Closes #9104
2022-07-05 10:16:05 +02:00
Daniel Stenberg
1d85d2e4f9
urldata: make 'use_port' an usigned short
... instead of a long. It is already enforced to not attempt to set any
value outside of 16 bits unsigned.

Closes #9099
2022-07-04 19:42:40 +02:00
Daniel Stenberg
e6f8445ede
setopt: add CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR
... as replacements for deprecated CURLOPT_PROTOCOLS and
CURLOPT_REDIR_PROTOCOLS as these new ones do not risk running into the
32 bit limit the old ones are facing.

CURLINFO_PROTCOOL is now deprecated.

The curl tool is updated to use the new options.

Added test 1597 to verify the libcurl protocol parser.

Closes #8992
2022-07-04 08:35:09 +02:00
Daniel Stenberg
1dda49a1d3
curl.h: CURLE_CONV_FAILED is obsoleted
The last use was removed in 7.82.0. Updated some docs too to reflect the
current error code situation.

Closes #9067
2022-06-29 16:03:02 +02:00
Daniel Stenberg
8ab4499552
curl_mime_data.3: polish the wording
Closes #9063
2022-06-28 17:00:00 +02:00
Samuel Henrique
aa34135e8f
libcurl-security.3: fix typo on macro "SH_"
During the packaging of the latest curl release for Debian, Lintian
warned me about a typo which causes the section name "Secrets in memory"
to not be rendered in the manpage due to "SH_" not being recognized as a
header.

Closes #9057
2022-06-27 23:59:18 +02:00
Daniel Stenberg
d56dbf0a16
CURLOPT_ALTSVC.3: document the file format
Closes #9033
2022-06-21 23:48:00 +02:00
divinity76
8dcbb0f191
CURLOPT_HTTPHEADER.3: improve comment in example
Closes #9025
2022-06-17 23:12:17 +02:00
Jay Satiro
a8a4abb2ae vtls: make curl_global_sslset thread-safe
.. and update some docs to explain curl_global_* is now thread-safe.

Follow-up to 23af112 which made curl_global_init/cleanup thread-safe.

Closes https://github.com/curl/curl/pull/9016
2022-06-16 03:18:40 -04:00
Jay Satiro
9135275f86 curl_easy_pause.3: remove explanation of progress function
- Remove misleading text that says progress function "gets called at
  least once per second, even if the connection is paused."

The progress function behavior is more nuanced and the user is better
served reading the progress function doc rather than attempt to explain
it in the curl_easy_pause doc.

The progress function can only be called at least once per second if an
appropriate multi transfer function is called (eg curl_multi_perform) in
that time. For a paused transfer there may not be such a call. Rather
than explain this in detail in the curl_easy_pause doc, rely on the user
reading the CURLOPT_PROGRESSFUNCTION doc.

Ref: https://github.com/curl/curl/issues/8983

Closes https://github.com/curl/curl/pull/9015
2022-06-16 03:18:04 -04:00
Daniel Stenberg
2b7f7d04f7
reuse/dep5: adjusted to parse better
... adjusted a few files to contain copyright and license info.

Closes #9006
2022-06-14 14:07:02 +02:00
Viktor Szakats
a94d6fe706
version: rename threadsafe-init to threadsafe
Referring to Daniel's article [1], making the init function thread-safe
was the last bit to make libcurl thread-safe as a whole. So the name of
the feature may as well be the more concise 'threadsafe', also telling
the story that libcurl is now fully thread-safe, not just its init
function. Chances are high that libcurl wants to remain so in the
future, so there is little likelihood of ever needing any other distinct
`threadsafe-<name>` feature flags.

For consistency we also shorten `CURL_VERSION_THREADSAFE_INIT` to
`CURL_VERSION_THREADSAFE`, update its description and reference libcurl's
thread safety documentation.

[1]: https://daniel.haxx.se/blog/2022/06/08/making-libcurl-init-more-thread-safe/

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro
Closes #8989
2022-06-13 18:59:45 +00:00
Daniel Stenberg
a36e6987e5
misc: add missing SPDX-License-Identifier info
For some reason the REUSE CI job did not find these.

Closes #8999
2022-06-13 10:08:17 +02:00
max.mehl
ad9bc5976d
copyright: make repository REUSE compliant
Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the file
`.reuse/dep5`.

This commit also adds a Github workflow to check pull requests and adapts
copyright.pl to the changes.

Closes #8869
2022-06-13 09:13:00 +02:00
Daniel Stenberg
965119855d
curl_url_set.3: clarify by default using known schemes only
Closes #8994
2022-06-12 23:10:51 +02:00
Daniel Stenberg
5912da253b
select: return error from "lethal" poll/select errors
Adds two new error codes: CURLE_UNRECOVERABLE_POLL and
CURLM_UNRECOVERABLE_POLL one each for the easy and the multi interfaces.

Reported-by: Harry Sintonen
Fixes #8921
Closes #8961
2022-06-08 11:07:01 +02:00
Jay Satiro
ae8a329e81 curl_global_init.3: Separate the Windows loader lock warning
This is a slight correction of the parent commit which implied the
loader lock warning only applied if not thread-safe. In fact the loader
lock warning applies either way.

Ref: https://github.com/curl/curl/pull/8972#discussion_r891987030
2022-06-08 03:02:51 -04:00
Daniel Stenberg
ba47566863
curl_global_init.3: this is now (usually) thread-safe
Follow-up to 23af112f55

Closes #8972
2022-06-08 08:50:15 +02:00
Haxatron
23408f1fd2 libcurl-security.3: Document CRLF header injection
- Document that user input to header options is not sanitized, which
  could result in CRLF used to modify the request in a way other than
  what was intended.

Ref: https://hackerone.com/reports/1589877
Ref: https://medium.com/@tomnomnom/crlf-injection-into-phps-curl-options-e2e0d7cfe545

Closes https://github.com/curl/curl/pull/8964
2022-06-08 02:32:35 -04:00
Jay Satiro
c11380d213 CURLOPT_RANGE.3: remove ranged upload advice
The e-mail link in the advice contains instructions that are prone to
error. We need an example that works and can demonstrate how to properly
perform a ranged upload, and then we can refer to that example instead.

Bug: https://github.com/curl/curl/issues/8969
Reported-by: Simon Berger

Closes https://github.com/curl/curl/pull/8970
2022-06-08 01:47:17 -04:00
Thomas Guillem
2ed1012564
curl_version_info: add CURL_VERSION_THREADSAFE_INIT
This flag can be used to make sure that curl_global_init() is
thread-safe.

This can be useful for libraries that can't control what other
dependencies are doing with Curl.

Closes #8680
2022-06-07 13:34:03 +02:00
Fabian Keil
9dbce9b3d0
misc: spelling improvements
Closes #8956
2022-06-05 12:15:23 +02:00
Wolf Vollprecht
4d4eb8e587
netrc: check %USERPROFILE% as well on Windows
Closes #8855
2022-06-02 09:32:51 +02:00
Daniel Stenberg
665138b2dd
CURLOPT_SSH_HOSTKEYDATA/FUNCTION.3: minor polish 2022-06-02 09:30:52 +02:00
michael musset
1544513958
libssh2: add CURLOPT_SSH_HOSTKEYFUNCTION
The callback set by CURLOPT_SSH_HOSTKEYFUNCTION is called to check
wether or not the connection should continue.

The host key is passed in argument with a custom handle for the
application.

It overrides CURLOPT_SSH_KNOWNHOSTS

Closes #7959
2022-06-02 08:34:31 +02:00
Daniel Stenberg
8b1ae28509
urldata: store tcp_keepidle and tcp_keepintvl as ints
They can't be set larger than INT_MAX in the setsocket API calls.

Also document the max values in their respective man pages.

Closes #8940
2022-06-01 08:12:09 +02:00
Daniel Stenberg
c80f0aebbb
CURLOPT_FILETIME.3: fix the protocols this works with 2022-05-31 17:40:47 +02:00
Daniel Stenberg
b2175acc76
CURLOPT_PORT.3: We discourage using this option
Closes #8941
2022-05-31 15:58:20 +02:00
Daniel Stenberg
c31752a50e
CURLOPT_NETRC.3: document the .netrc file format 2022-05-31 09:05:01 +02:00
Daniel Stenberg
b1f8d50a92
curl_getdate.3: document that some illegal dates pass through
Closes #8938
2022-05-31 09:03:50 +02:00
Daniel Stenberg
4d94fac9f0
headers api: remove EXPERIMENTAL tag
Closes #8900
2022-05-30 14:13:48 +02:00
Daniel Stenberg
22eab9d413
CURLINFO_CAINFO/PATH.3: clarify the multiple TLS situation
Spell out the multi-TLS situation.

Reported-by: Dan Fandrich
Fixes #8926
Closes #8932
2022-05-29 17:01:42 +02:00
Daniel Stenberg
c9b60f0053
http: restore header folding behavior
Folded header lines will now get passed through like before. The headers
API is adapted and will provide the content unfolded.

Added test 1274 and extended test 1940 to verify.

Reported-by: Petr Pisar
Fixes #8844
Closes #8899
2022-05-24 23:33:47 +02:00
Daniel Stenberg
7bc785387d
CURLINFO_CAPATH/CAINFO: get the default CA paths from libcurl
Closes #8888
2022-05-23 08:44:29 +02:00
Daniel Stenberg
7f2e1d345a
libcurl-security.3: add "Secrets in memory"
Closes #8881
2022-05-20 17:36:25 +02:00
Balakrishnan Balasubramanian
dfa84a0450
socks: support unix sockets for socks proxy
Usage:
  curl -x "socks5h://localhost/run/tor/socks" "https://example.com"

Updated runtests.pl to run a socksd server listening on unix socket

Added tests test1467 test1468

Added documentation for proxy command line option and socks proxy
options

Closes #8668
2022-05-19 15:35:03 +02:00
Daniel Stenberg
8d86718f3f
opts: deprecate RANDOM_FILE and EGDSOCKET
These two options were only ever used for the OpenSSL backend for
versions before 1.1.0. They were never used for other backends and they
are not used with recent OpenSSL versions. They were never used much by
applications.

The defines RANDOM_FILE and EGD_SOCKET can still be set at build-time
for ancient EOL OpenSSL versions.

Closes #8670
2022-05-17 11:05:54 +02:00
Daniel Gustafsson
2df67e93c3 docs: clarify data replacement policy for MIME API
The API documentation for the MIME functions specify that the parts
can be set twice, with the last call winning.  While true, the user
can set the parts n times for n > 2, reword to specify multiple API
calls instead.

Closes: #8860
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-05-16 20:32:38 +02:00
Daniel Stenberg
dd4f2622bc
CURLOPT_SSH_AUTH_TYPES.3: fix the default
The default is all possible methods.

Closes #8792
2022-05-04 23:31:24 +02:00
Daniel Stenberg
851fb743db
CURLOPT_DOH_URL.3: mention the known bug
It is mostly duplicating info from KNOWN_BUGS but make it easier to find
for users of this option.

Closes #8790
2022-05-04 14:44:16 +02:00
Daniel Stenberg
55e137bdf5
CURLOPT_HSTS*FUNCTION.3: document the involved structs as well
Reviewed-By: Daniel Gustafsson
Closes #8788
2022-05-03 17:18:28 +02:00
Daniel Stenberg
d2a36beee6
CURLOPT*TLSAUTH: they only work with OpenSSL or GnuTLS
Closes #8753
2022-04-26 07:45:08 +02:00
Daniel Stenberg
4ec0549c39
misc: update copyright year ranges 2022-04-25 09:31:09 +02:00
Kushal Das
94ac2ca775
docs: updates spellings with full words
Closes #8730
2022-04-21 17:07:10 +02:00
Daniel Stenberg
d794d4bce2
libcurl-tutorial.3: spellfix and minor polish 2022-04-20 10:56:41 +02:00
Daniel Stenberg
1c92b101c4
CURLINFO_PRIMARY_PORT.3: spellfix
Reported-by: Patrick Monnerat
2022-04-20 10:46:51 +02:00
Daniel Stenberg
f7f26077bc
CURLINFO_PRIMARY_PORT.3: clarify which port this is
As it was not entirely clear previously.

Closes #8725
2022-04-19 23:06:12 +02:00
Daniel Stenberg
774dbd520a
CURLOPT_UNRESTRICTED_AUTH.3: extended explanation
Include details about Authentication headers.

Reported-by: Brad Spencer
Fixes #8724
Closes #8726
2022-04-19 18:15:02 +02:00
Daniel Gustafsson
fe87e10c81 docs: Fix missing semicolon in example code
Multiple share examples were missing a semicolon on the line defining
the CURLSHcode variable.

Closes: #8697
Reported-by: Michael Kaufmann <mail@michael-kaufmann.ch>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-04-15 23:35:15 +02:00
Daniel Gustafsson
b7c0bd68ff curl_easy_header: fix typos in documentation
Closes: #8694
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-04-11 11:25:13 +02:00
Daniel Stenberg
4a8f6869db
English: use American spelling consistently
Authorization, Initialization, Organization etc.

Closes #8673
2022-04-05 14:55:47 +02:00
Daniel Stenberg
89e6129e5a
CURLOPT_PREQUOTE.3: only works for FTP file transfers, not dirs
Also add to quote.d. Add to TODO as something to add in a future.

Reported-by: anon00000000 on github
Closes #8602
Closes #8648
2022-03-29 18:15:44 +02:00
Daniel Stenberg
3a4182d468
docs: lots of minor language polish
Mostly based on recent language decisions from "everything curl":

- remove contractions (isn't => is not)
- *an* HTTP (consistency)
- runtime (no hyphen)
- backend (no hyphen)
- URL is uppercase

Closes #8646
2022-03-29 13:58:14 +02:00
Daniel Stenberg
301bd97965
CURLOPT_DISALLOW_USERNAME_IN_URL.3: use uppercase URL 2022-03-28 19:40:47 +02:00
Farzin
47048e0287
CURLOPT_PROGRESSFUNCTION.3: fix typo in example
Closes #8636
2022-03-25 16:53:30 +01:00
Jay Satiro
cabcf403ed docs/opts: Mention Schannel client cert type is P12
Schannel backend code behaves same as Secure Transport, it expects a P12
certificate file or the name of a certificate already in the user's OS
key store. Also, both backends ignore CURLOPT_SSLKEY (tool: --key)
because they expect the private key to already be available from the
keystore or P12 certificate.

Ref: https://github.com/curl/curl/discussions/8581#discussioncomment-2337260

Closes https://github.com/curl/curl/pull/8587
2022-03-22 14:24:06 -04:00
Daniel Stenberg
f07be5d1fa
curl_easy_nextheader.3: fix two typos
Reported-by: Timothe Litt
Bug: https://curl.se/mail/lib-2022-03/0060.html
2022-03-22 11:52:37 +01:00
Daniel Stenberg
d1e4a67734
header api: add curl_easy_header and curl_easy_nextheader
Add test 1940 to 1946 to verify.

Closes #8593
2022-03-22 08:24:22 +01:00
Jan Venekamp
3b4a353025
BearSSL: add CURLOPT_SSL_CTX_FUNCTION support
Closes #8478
2022-03-12 23:03:37 +01:00
Jan Venekamp
f5d79619b1
BearSSL: add CURLOPT_SSL_CIPHER_LIST support
Closes #8477
2022-03-12 22:59:45 +01:00
Daniel Stenberg
475e451766
CURLSHOPT_UNLOCKFUNC.3: fix the callback prototype
Copy and paste error

Reported-by: Francisco Olarte
Fixes #8573
Closes #8577
2022-03-10 23:01:37 +01:00
Daniel Stenberg
1fa09990ab
misc: update copyright year ranges 2022-03-05 09:41:24 +01:00
Farzin
0aa9ea99d2 CURLOPT_XFERINFOFUNCTION.3: fix example struct assignment
Closes https://github.com/curl/curl/pull/8519
2022-02-27 12:17:51 -05:00
Farzin
4517d8eb6f CURLOPT_PROGRESSFUNCTION.3: fix example struct assignment
Closes https://github.com/curl/curl/pull/8500
2022-02-23 03:13:11 -05:00
Daniel Stenberg
a63c91adfa
CURLOPT_XFERINFOFUNCTION.3: fix typo in example
Reported-by: coralw on github
Fixes #8487
Closes #8488
2022-02-21 10:28:34 +01:00
Jay Satiro
e0dc9765a7 multi: allow user callbacks to call curl_multi_assign
Several years ago a change was made to block user callbacks from calling
back into the API when not supported (recursive calls). One of the calls
blocked was curl_multi_assign. Recently the blocking was extended to the
multi interface API, however curl_multi_assign may need to be called
from within those user callbacks (eg CURLMOPT_SOCKETFUNCTION).

I can't think of any callback where it would be unsafe to call
curl_multi_assign so I removed the restriction entirely.

Reported-by: Michael Wallner

Ref: https://github.com/curl/curl/commit/b46cfbc
Ref: https://github.com/curl/curl/commit/340bb19

Fixes https://github.com/curl/curl/issues/8480
Closes https://github.com/curl/curl/pull/8483
2022-02-21 03:23:12 -05:00
Daniel Stenberg
2610142139
lib: remove support for CURL_DOES_CONVERSIONS
TPF was the only user and support for that was dropped.

Closes #8378
2022-02-04 08:05:35 +01:00
Bjarni Ingi Gislason
1ce1f0b5a0
curl_getdate.3: remove pointless .PP line
mandoc: WARNING: skipping paragraph macro: PP empty

Reported-by: Samuel Henrique
Closes #8365
2022-02-01 09:45:37 +01:00
Samuel Henrique
7e30252ec3
CURLSHOPT_LOCKFUNC.3: fix typo "relased" -> "released"
Found when packaging 7.81.0 for Debian.

Closes #8364
2022-01-31 22:43:30 +01:00
Daniel Stenberg
cdb495f743
docs: document HTTP/2 not insisting on TLS 1.2
Both for --http2 and CURLOPT_HTTP_VERSION.

Reported-by: jhoyla on github
Fixes #8235
Closes #8300
2022-01-19 23:30:07 +01:00
Daniel Stenberg
c24764ef59
CURLMOPT_TIMERFUNCTION/DATA.3: fix the examples
... to not call libcurl recursively back.

Closes #8286
2022-01-17 16:45:28 +01:00
Niels Martignène
6c084fd47c mbedtls: fix CURLOPT_SSLCERT_BLOB (again)
- Increase the buffer length passed to mbedtls_x509_crt_parse to account
  for the null byte appended to the temporary blob.

Follow-up to 867ad1c which uses a null terminated copy of the
certificate blob, because mbedtls_x509_crt_parse requires PEM data
to be null terminated.

Ref: https://github.com/curl/curl/commit/867ad1c#r63439893
Ref: https://github.com/curl/curl/pull/8146

Closes https://github.com/curl/curl/pull/8260
2022-01-15 16:57:36 -05:00
Daniel Stenberg
cb0c7970f0
curl_multi_socket.3: remove callback and typical usage descriptions
1. The callback is better described in the option for setting it. Having
it in a single place reduces the risk that one of them is wrong.

2. The "typical usage" is wrong since the functions described in this
man page are both deprecated so they cannot be used in any "typical" way
anymore.

Closes #8262
2022-01-12 09:30:48 +01:00
Patrick Monnerat
eeca818b1e
openldap: implement SASL authentication
As credentials can be quite different depending on the mechanism used,
there are no default mechanisms for LDAP and simple bind with a DN is
then used.

The caller has to provide mechanism(s) using CURLOPT_LOGIN_OPTIONS to
enable SASL authentication and disable simple bind.

Closes #8152
2022-01-11 11:17:27 +01:00
Cameron Will
ce5463e60c CURLOPT_RESOLVE.3: change example port to 443
83cc966 changed documentation from using http to https. However,
CURLOPT_RESOLVE being set to port 80 in the documentation means that it
isn't valid for the new URL. Update to 443.

Closes https://github.com/curl/curl/pull/8258
2022-01-10 22:23:57 -05:00
Daniel Stenberg
223f26c28a
mesalink: remove support
Mesalink has ceased development. We can no longer encourage use of it.
It seems to be continued under the name TabbySSL, but no attempts have
(yet) been to make curl support it.

Fixes #8188
Closes #8191
2022-01-10 11:27:59 +01:00
Daniel Stenberg
7edb0fcf3f
ldap: return CURLE_URL_MALFORMAT for bad URL
For consistency, use the same return code for URL malformats,
independently of what scheme that is used. Previously this would return
CURLE_LDAP_INVALID_URL, but starting now that error cannot be returned.

Closes #8170
2022-01-10 09:37:47 +01:00
Stephen M. Coakley
3be94d84fc
rustls: add CURLOPT_CAINFO_BLOB support
Add support for `CURLOPT_CAINFO_BLOB` `CURLOPT_PROXY_CAINFO_BLOB` to the
rustls TLS backend. Multiple certificates in a single PEM string are
supported just like OpenSSL does with this option.

This is compatible at least with rustls-ffi 0.8+ which is our new
minimum version anyway.

I was able to build and run this on Windows, pulling trusted certs from
the system and then add them to rustls by setting
`CURLOPT_CAINFO_BLOB`. Handy!

Closes #8255
2022-01-10 09:30:12 +01:00
Daniel Stenberg
d1237ac906
url: given a user in the URL, find pwd for that user in netrc
Add test 380 and 381 to verify, edited test 133

Reported-by: Manfred Schwarb
Fixes #8241
Closes #8243
2022-01-09 14:16:41 +01:00
Daniel Stenberg
40eec3f80e
curl_url_set.3: mention when CURLU_ALLOW_SPACE was added 2022-01-08 00:28:52 +01:00
Daniel Stenberg
a338d86885
docs: fix mandoc -T lint formatting complaints
Closes #8228
2022-01-05 22:45:02 +01:00
Daniel Stenberg
0c416edbec
curl_multi_init.3: fix the copyright year range 2022-01-05 00:35:58 +01:00
Jay Satiro
53a3e90e06 curl_multi_init.3: fix EXAMPLE formatting 2022-01-03 15:14:45 -05:00
Daniel Stenberg
193053e2ed
libcurl-multi.3: "SOCKS proxy handshakes" are not blocking
Since 4a4b63daaa
2021-12-23 10:19:06 +01:00
Daniel Stenberg
e7e5cc4c63
language: "email"
Missed three occurrences.

Follow-up to 7a92f86
2021-12-20 13:49:37 +01:00
Daniel Stenberg
7a92f865b4
misc: s/e-mail/email
Consistency is king. Following the lead in everything curl.

Closes #8159
2021-12-19 23:48:13 +01:00
Dan Fandrich
bedd44f434 libcurl-security.3: mention address and URL mitigations
The new CURLOPT_PREREQFUNCTION callback is another way to sanitize
addresses.
Using the curl_url API is a way to mitigate against attacks relying on
URL parsing differences.
2021-12-15 00:14:29 -08:00
Patrick Monnerat
cdc1da9120
openldap: several minor improvements
- Early check proper LDAP URL syntax. Reject URLs with a userinfo part.
- Use dynamic memory for ldap_init_fd() URL rather than a
  stack-allocated buffer.
- Never chase referrals: supporting it would require additional parallel
  connections and alternate authentication credentials.
- Do not wait 1 microsecond while polling/reading query response data.
- Store last received server code for retrieval with CURLINFO_RESPONSE_CODE.

Closes #8140
2021-12-15 08:07:53 +01:00
RekGRpth
98ae5d8ebc
CURLSHOPT_USERDATA.3: fix copy-paste mistake
Closes #8124
2021-12-09 14:31:22 +01:00
Daniel Stenberg
d6934d393d
docs: fix minor nroff format nits
Repairs test 1140

Follow-up to 436cdf8204
2021-12-09 13:18:27 +01:00
Daniel Stenberg
436cdf8204
curl_multi_perform/socket_action.3: clarify what errors mean
An error returned from one of these funtions mean that ALL still ongoing
transfers are to be considered failed.

Ref: #8114
Closes #8120
2021-12-09 10:23:19 +01:00
Daniel Stenberg
e067f46c4d
libcurl-errors.3: add CURLM_ABORTED_BY_CALLBACK
Follow-up to #8089 (2b3dd01)

Closes #8116
2021-12-09 10:21:36 +01:00
Daniel Stenberg
51a2e3ff1b
CURLOPT_RESOLVE.3: minor polish
Minor rephrasing for some explanations.

Put the format strings in stand-alone lines with .nf/.fi to be easier to spot.

Move "added in" to AVAILABILITY

Closed #8110
2021-12-07 17:13:55 +01:00
Daniel Stenberg
1a4c14cbac
CURLOPT_STDERR.3: does not work with libcurl as a win32 DLL
This is the exact same limitation already documented for
CURLOPT_WRITEDATA but should be clarified here. It also has a different
work-around.

Reported-by: Stephane Pellegrino
Bug: https://github.com/curl/curl/issues/8102
Closes #8103
2021-12-06 16:43:28 +01:00
Daniel Stenberg
2b3dd01b77
multi: handle errors returned from socket/timer callbacks
The callbacks were partially documented to support this. Now the
behavior is documented and returning error from either of these
callbacks will effectively kill all currently ongoing transfers.

Added test 530 to verify

Reported-by: Marcelo Juchem
Fixes #8083
Closes #8089
2021-12-06 14:55:52 +01:00
Patrick Monnerat
a40160aee8
openldap: implement STARTTLS
As this introduces use of CURLOPT_USE_SSL option for LDAP, also check
this option in ldap.c as it is not supported by this backend.

Closes #8065
2021-12-06 07:53:04 +01:00
Jun Tseng
a6e2643433
curl_easy_unescape.3: call curl_easy_cleanup in example
Closes #8097
2021-12-06 07:50:37 +01:00
Jun Tseng
a42f60d94f
curl_easy_escape.3: call curl_easy_cleanup in example
Closes #8097
2021-12-06 07:50:29 +01:00
Daniel Stenberg
c8a3046555
CURLMOPT_TIMERFUNCTION.3: call it expire time, not interval
Since we say it is a non-repating timer
2021-12-02 12:05:48 +01:00
Florian Van Heghe
8443f975c0
mbedTLS: add support for CURLOPT_CAINFO_BLOB
Closes #8071
2021-11-30 16:19:46 +01:00
Daniel Stenberg
230bb3e278
docs: consistent manpage SYNOPSIS
Make all libcurl related options use .nf (no fill) for the SYNOPSIS
section - for consistent look. roffit then renders that section using
<pre> (monospace font) in html for the website.

Extended manpage-syntax (test 1173) with a basic check for it.

Closes #8062
2021-11-26 16:51:23 +01:00
Daniel Stenberg
76d6e719d9
docs: address proselint nits
- avoid exclamation marks
- use consistent number of spaces after periods: one
- avoid clichés
- avoid using 'very'

Closes #8060
2021-11-26 14:27:07 +01:00
Daniel Stenberg
4183b8fe9a
urlapi: provide more detailed return codes
Previously, the return code CURLUE_MALFORMED_INPUT was used for almost
30 different URL format violations. This made it hard for users to
understand why a particular URL was not acceptable. Since the API cannot
point out a specific position within the URL for the problem, this now
instead introduces a number of additional and more fine-grained error
codes to allow the API to return more exactly in what "part" or section
of the URL a problem was detected.

Also bug-fixes curl_url_get() with CURLUPART_ZONEID, which previously
returned CURLUE_OK even if no zoneid existed.

Test cases in 1560 have been adjusted and extended. Tests 1538 and 1559
have been updated.

Updated libcurl-errors.3 and curl_url_strerror() accordingly.

Closes #8049
2021-11-25 08:36:04 +01:00
Daniel Stenberg
a5f5687368
urlapi: make Curl_is_absolute_url always use MAX_SCHEME_LEN
Instad of having all callers pass in the maximum length, always use
it. The passed in length is instead used only as the length of the
target buffer for to storing the scheme name in, if used.

Added the scheme max length restriction to the curl_url_set.3 man page.

Follow-up to 45bcb2eaa7

Closes #8047
2021-11-25 08:33:48 +01:00