Commit Graph

28403 Commits

Author SHA1 Message Date
Daniel Stenberg
e7793cb57b
curl/header_json: output the header names in lowercase
To better allow json[“header”].

Reported-by: Peter Korsgaard
Bug: https://daniel.haxx.se/blog/2022/03/24/easier-header-picking-with-curl/comment-page-1/#comment-25878
Closes #8633
2022-03-25 11:24:27 +01:00
Daniel Stenberg
f718a91547
RELEASE-NOTES: synced 2022-03-24 15:51:43 +01:00
Daniel Stenberg
c2610db63e
headers.h: make Curl_headers_push() be CURLE_OK when not built
... to avoid errors when the function isn't there.

Reported-by: Marcel Raad
Fixes #8627
Closes #8628
2022-03-24 00:52:34 +01:00
Daniel Stenberg
8e22fc68e7
scripts: move three scripts from lib/ to scripts/
Move checksrc.pl, firefox-db2pem.sh and mk-ca-bundle.pl since they don't
particularly belong in lib/

Also created an EXTRA_DIST= in scripts/Makefile.am instead of specifying
those files in the root Makefile.am

Closes #8625
2022-03-23 15:26:11 +01:00
Marc Hoersken
b478d59e9d
lib/warnless.[ch]: only check for WIN32 and ignore _WIN32
curl_setup.h automatically defines WIN32 if just _WIN32 is defined.

Therefore make sure curl_setup.h is included through warnless.h.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Closes #8594
2022-03-23 05:00:10 +01:00
Marc Hoersken
24f0fec405
tests/server/util.h: align WIN32 condition with util.c
There is no need to test for both _WIN32 and WIN32 as curl_setup.h
automatically defines the later if the first one is defined.

Also tests/server/util.c is only checking for WIN32 arouund the
implementation of win32_perror, so just defining _WIN32
would not be sufficient for a successful compilation.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Closes #8594
2022-03-23 05:00:04 +01:00
Philip H
98b40c61bc
firefox-db2pem.sh: make the shell script safer
Reported by lift

Closes #8616
2022-03-22 23:14:34 +01:00
Jay Satiro
8b1cae63b7 gtls: fix build for disabled TLS-SRP
Prior to this change if, at build time, the GnuTLS backend was found to
have TLS-SRP support (HAVE_GNUTLS_SRP) but TLS-SRP was disabled in curl
via --disable-tls-srp (!USE_TLS_SRP) then a build error would occur.

Bug: https://curl.se/mail/lib-2022-03/0046.html
Reported-by: Robert Brose

Closes https://github.com/curl/curl/pull/8604
2022-03-22 14:24:08 -04:00
Jay Satiro
ccea329848 winbuild: Add a Visual Studio example to the README
- Add an example that explains in detail how the user can add libcurl to
  their Visual Studio project.

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

Closes https://github.com/curl/curl/pull/8592
2022-03-22 14:24:07 -04: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
ba4a8fa4d1
lib1945: fix compiler warning 4706 on MSVC
Follow-up from d1e4a67734

Closes #8623
2022-03-22 16:40:03 +01:00
Philip H
8c3859b2a3
ci/event-based.yml: improve impacket install
skip python3-pip
install impacket with library module

Closes #8621
2022-03-22 16:38:47 +01:00
Daniel Stenberg
23540923e1
test1459: disable for oldlibssh
This test with libssh 0.9.3 works fine on github but fails on circleci.
Might as well disable this test for oldlibssh installations.

Closes #8622
2022-03-22 16:36:10 +01:00
Daniel Stenberg
2e1ef61560
test1135: sync with recent API updates
This test verifies that the order of functions in public headers remain
the same but hasn't been updated to care for recently added header
files. The order is important for some few platforms - or VERSIONINFO
needs to updated.

This fix also updates VERSIONINFO to be sure.

Closes #8620
2022-03-22 14:28:18 +01: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
ca2c30bcc0
options: remove mistaken space before paren in prototype 2022-03-22 11:09:22 +01:00
Daniel Stenberg
d79b1ead74
cirrus: add --enable-headers-api for some windows builds 2022-03-22 08:24:26 +01:00
Daniel Stenberg
ea0ada834e
GHA: --enable-headers-api in all workflows 2022-03-22 08:24:26 +01:00
Daniel Stenberg
ac81a9c9ae
lib: make the headers API depend on --enable-headers-api 2022-03-22 08:24:26 +01:00
Daniel Stenberg
7c8c723682
configure: add --enable-headers-api to enable the headers API
Defaults to disabled while labeled EXPERIMENTAL.

Make all the headers API tests require 'headers-api' to run.
2022-03-22 08:24:26 +01:00
Daniel Stenberg
160b640a8b
test1671: verify -w '%{header_json} 2022-03-22 08:24:25 +01:00
Daniel Stenberg
62b60ed1a0
test1670: verify -w %header{} 2022-03-22 08:24:25 +01:00
Daniel Stenberg
4133a69f2d
curl: add %{header_json} support in -w handling
Outputs all response headers as a JSON object.
2022-03-22 08:24:25 +01:00
Daniel Stenberg
2d45137e1e
curl: add %header{name} support in -w handling
Outputs the response header 'name'
2022-03-22 08:24:25 +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
Daniel Stenberg
bdc664a640
test1459: remove the different exit code for oldlibssh
When using libssh/0.9.3/openssl/zlib, we seem to be getting the "right"
error code.

Closes #8490
2022-03-21 17:41:30 +01:00
Daniel Stenberg
59c44c76de
libssh: unstick SFTP transfers when done event-based
Test 604 and 606 (at least).

Closes #8490
2022-03-21 17:41:20 +01:00
Daniel Stenberg
5bb4d3ec06
gha: move the event-based test over from Zuul
Switched libssh2 to libssh

Closes #8490
2022-03-21 17:39:49 +01:00
Daniel Stenberg
02173e2341
RELEASE-NOTES: synced 2022-03-21 08:43:14 +01:00
Daniel Stenberg
dcdf2e8a36
http: return error on colon-less HTTP headers
It's a protocol violation and accepting them leads to no good.

Add test case 398 to verify

Closes #8610
2022-03-21 08:37:24 +01:00
Daniel Stenberg
33fe8251cb
test718: edited slightly to return better HTTP
Since hyper is picky and won't play ball otherwise.

Bug: https://github.com/hyperium/hyper/issues/2783
Reported-by: Daniel Valenzuela
Closes #8614
2022-03-20 22:54:49 +01:00
Daniel Stenberg
7e145dd270
hyper: no h2c support
Make tests require h2c feature present to run, and only set h2c if
nghttp2 is used in the build. Hyper does not support it.

Remove those tests from DISABLED

Fixes #8605
Closes #8613
2022-03-20 16:45:08 +01:00
Daniel Stenberg
a7ee34259e
configure: bump the copyright year range int the generated output 2022-03-19 22:21:30 +01:00
Andreas Falkenhahn
c20a516d03
BINDINGS.md: add Hollywood binding
Closes #8609
2022-03-18 23:03:42 +01:00
Daniel Stenberg
563d1f9037
HISTORY: add some 2022 data 2022-03-18 10:04:20 +01:00
Daniel Stenberg
5ab9b15427
scripts/copyright.pl: ignore the new mlc_config.json file 2022-03-18 09:15:15 +01:00
Philip H
fe4913ff55
mlc_config.json: add file to ignore known troublesome URLs
This is the config file for the CI markdown link checker and lets us
filter URLs that are known to cause problems. Like
https://curl.zuul.vexxhost.dev/ for now.

Closes #8597
2022-03-18 09:13:09 +01:00
Philip H
c652621928
winbuild/README.md: fixup dead link
Closes #8597
2022-03-18 09:10:56 +01:00
Jay Satiro
acf46b1bba rtsp: don't let CSeq error override earlier errors
- When done, if an error has already occurred then don't check the
  sequence numbers for mismatch.

A sequence number may not have been received if an error occurred.

Prior to this change a sequence mismatch error would override earlier
errors. For example, a server that returns nothing would cause error
CURLE_GOT_NOTHING in Curl_http_done which was then overridden by
CURLE_RTSP_CSEQ_ERROR in rtsp_done.

Closes https://github.com/curl/curl/pull/8525
2022-03-18 03:24:37 -04:00
Jay Satiro
d3cb3be520 lib: fix some misuse of curlx_convert_wchar_to_UTF8
curlx_convert_wchar_to_UTF8 must be freed by curlx_unicodefree, but
prior to this change some uses mistakenly called free.

I've reviewed all other uses of curlx_convert_wchar_to_UTF8 and
curlx_convert_UTF8_to_wchar.

Ref: https://github.com/curl/curl/commit/1d5d0ae

Closes https://github.com/curl/curl/pull/8521
2022-03-18 03:20:03 -04:00
Jay Satiro
45cb662b87 mk-ca-bundle.pl: Use stricter logic to process the certificates
.. and bump version to 1.29.

This change makes the script properly ignore unknown blocks and
otherwise fail when Mozilla changes the certdata format in ways we
don't expect. Though this is less flexible behavior it makes it far less
likely that an invalid certificate can slip through.

Prior to this change the state machine did not always properly reset,
and it was possible that a certificate marked as invalid could then
later be marked as valid when there was conflicting trust info or
an unknown block was erroneously processed as part of the certificate.

Ref: https://github.com/curl/curl/pull/7801#pullrequestreview-768384569

Closes https://github.com/curl/curl/pull/8411
2022-03-18 03:15:44 -04:00
Marcel Raad
265c50b2f8
test375: fix line endings on Windows
Closes https://github.com/curl/curl/pull/8599
2022-03-17 14:24:14 +01:00
Daniel Stenberg
526e0ef4cb
http: reject header contents with nul bytes
They are not allowed by the protocol and allowing them risk that curl
misbehaves somewhere where C functions are used but won't work on the
full contents. Further, they are not supported by hyper and they cause
problems for the new coming headers API work.

Updated test 262 to verify and enabled it for hyper as well

Closes #8601
2022-03-17 10:17:31 +01:00
Philip H
22d33956ec
CI: Do not use buildconf. Instead, just use: autoreconf -fi
Closes #8596
2022-03-15 14:15:35 +01:00
Daniel Stenberg
94fb2417b1
RELEASE-NOTES: synced 2022-03-15 10:48:47 +01:00
Jay Satiro
9d55fb4675 libssh: Improve fix for missing SSH_S_ stat macros
- If building libcurl against an old libssh version missing SSH_S_IFMT
  and SSH_S_IFLNK then use the values from a supported version.

Prior to this change if libssh did not define SSH_S_IFMT and SSH_S_IFLNK
then S_IFMT and S_IFLNK, respectively, were used instead. The problem
with that is the user's S_ stat macros don't have the same values across
platforms. For example Windows has values different from Linux.

Follow-up to 7b0fd39.

Ref: https://github.com/curl/curl/pull/8511#discussion_r815292391
Ref: https://github.com/curl/curl/pull/8574

Closes https://github.com/curl/curl/pull/8588
2022-03-14 03:31:20 -04:00
Marc Hoersken
8b42d7b9d4
tool and tests: force flush of all buffers at end of program
On Windows data can be lost in buffers in case of abnormal program
termination, especially in process chains as seen due to flaky tests.
Therefore flushing all buffers manually should avoid this data loss.

In the curl tool we play the safe game by only flushing write buffers,
but in the testsuite where we manage all buffers, we flush everything.

This should drastically reduce Windows CI and testsuite flakiness.

Reviewed-by: Daniel Stenberg

Supersedes #7833 and #6064
Closes #8516
2022-03-13 13:29:28 +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
Dan Fandrich
3055c4c814 tool_cb_hdr: Turn the Location: into a terminal hyperlink
This turns even relative URLs into clickable hyperlinks in a supported
terminal when --styled-output is enabled. Many terminals already turn
URLs into clickable links but there is not enough information in a
relative URL to do this automatically otherwise.
2022-03-11 17:25:35 -08:00