Commit Graph

29633 Commits

Author SHA1 Message Date
Daniel Stenberg
5c544b4912
c-hyper: move down the Accept-Encoding header generation
To match the internal HTTP request header order so that test 1277 works
again.

Closes #10200
2023-01-02 11:51:30 +01:00
Daniel Stenberg
9ca194b5e2
release-notes.pl: check fixes/closes lines better
To better skip lines that just happen to mention those words at the
start of a line without being instructions.
2023-01-02 11:31:29 +01:00
Daniel Stenberg
f27262b179
test1560: use a UTF8-using locale when run
There are odd cases that don't use UTF8 and then the IDN handling goes
wrong.

Reported-by: Marcel Raad
Fixes #10193
Closes #10196
2023-01-02 10:35:42 +01:00
Daniel Stenberg
36dce55629
cf-socket: fix build regression
Reported-by: Stephan Guilloux
Fixes #10190
Closes #10191
2023-01-02 10:34:14 +01:00
Daniel Stenberg
b8b483b0c4
examples: remove the curlgtk.c example
- it does not add a lot of value
- we do not test-build it to verify because of its dependencies
- unclear for what GTK versions it works or not

Reported-by: odek86 on github

Fixes #10197
Closes #10198
2023-01-02 10:19:35 +01:00
andy5995
d68e0a0cc2
docs: add link to GitHub Discussions
Closes #10171
2023-01-02 00:26:37 +01:00
andy5995
92abdaf8e2
GHA: ignore changes to md files for most workflows
Closes #10176
2023-01-02 00:13:02 +01:00
Josh Brobst
aa6e7a1f45
http: decode transfer encoding first
The unencoding stack is added to as Transfer-Encoding and
Content-Encoding fields are encountered with no distinction between the
two, meaning the stack will be incorrect if, e.g., the message has both
fields and a non-chunked Transfer-Encoding comes first. This commit
fixes this by ordering the stack with transfer encodings first.

Reviewed-by: Patrick Monnerat
Closes #10187
2023-01-02 00:06:15 +01:00
Daniel Stenberg
fc9f22b46e
curl.h: mark CURLSSLBACKEND_MESALINK as deprecated
Follow-up since 223f26c28a

Deprecated since 7.82.0

Closes #10189
2023-01-01 15:42:20 +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
Cameron Blomquist
99327018cf
http: add additional condition for including stdint.h
stdint.h was only included in http.h when ENABLE_QUIC was defined, but
symbols from stdint.h are also used when USE_NGHTTP2 is defined. This
causes build errors when USE_NGHTTP2 is defined but ENABLE_QUIC is not.

Closes #10185
2023-01-01 00:51:35 +01:00
Daniel Stenberg
becfe2ec78
urldata: cease storing TLS auth type
The only TLS auth type libcurl ever supported is SRP and that is the
default type. Since nobody ever sets any other type, there is no point
in wasting space to store the set type and code to check the type.

If TLS auth is used, SRP is now implied.

Closes #10181
2022-12-31 16:56:21 +01:00
Daniel Stenberg
df856cb5c9
vtls: use ALPN HTTP/1.0 when HTTP/1.0 is used
Previously libcurl would use the HTTP/1.1 ALPN id even when the
application specified HTTP/1.0.

Reported-by: William Tang
Ref: #10183
2022-12-31 16:53:21 +01:00
Marcel Raad
49f39dfac9
lib670: make test.h the first include
As in all other lib tests. This avoids a macro redefinition warning for
`_FILE_OFFSET_BITS` visible in the autobuilds.

Closes https://github.com/curl/curl/pull/10182
2022-12-30 21:57:35 +01:00
Stefan Eissing
71b7e01610
lib: connect/h2/h3 refactor
Refactoring of connection setup and happy eyeballing. Move
nghttp2. ngtcp2, quiche and msh3 into connection filters.

 - eyeballing cfilter that uses sub-filters for performing parallel connects
 - socket cfilter for all transport types, including QUIC
 - QUIC implementations in cfilter, can now participate in eyeballing
 - connection setup is more dynamic in order to adapt to what filter did
   really connect.  Relevant to see if a SSL filter needs to be added or
   if SSL has already been provided
 - HTTP/3 test cases similar to HTTP/2
 - multiuse of parallel transfers for HTTP/3, tested for ngtcp2 and quiche

 - Fix for data attach/detach in VTLS filters that could lead to crashes
   during parallel transfers.
 - Eliminating setup() methods in cfilters, no longer needed.
 - Improving Curl_conn_is_alive() to replace Curl_connalive() and
   integrated ssl alive checks into cfilter.
 - Adding CF_CNTRL_CONN_INFO_UPDATE to tell filters to update
   connection into and persist it at the easy handle.

 - Several more cfilter related cleanups and moves:
   - stream_weigth and dependency info is now wrapped in struct
     Curl_data_priority
   - Curl_data_priority members depend is available in HTTP2|HTTP3
   - Curl_data_priority members depend on NGHTTP2 support
   - handling init/reset/cleanup of priority part of url.c
   - data->state.priority same struct, but shallow copy for compares only

 - PROTOPT_STREAM has been removed
   - Curl_conn_is_mulitplex() now available to check on capability

 - Adding query method to connection filters.
   - ngtcp2+quiche: implementing query for max concurrent transfers.

 - Adding is_alive and keep_alive cfilter methods. Adding DATA_SETUP event.
   - setting keepalive timestamp on connect
   - DATA_SETUP is called after the connection has been completely
     setup (but may not connected yet) to allow filters to initialize
     data members they use.

 - there is no socket to be had with msh3, it is unclear how select
   shall work

 - manual test via "curl --http3 https://curl.se" fail with "empty
   reply from server".

 - Various socket/conn related cleanups:
   - Curl_socket is now Curl_socket_open and in cf-socket.c
   - Curl_closesocket is now Curl_socket_close and in cf-socket.c
   - Curl_ssl_use has been replaced with Cur_conn_is_ssl
   - Curl_conn_tcp_accepted_set has been split into
     Curl_conn_tcp_listen_set and Curl_conn_tcp_accepted_set
     with a clearer purpose

Closes #10141
2022-12-30 16:43:19 +01:00
Daniel Stenberg
1c18f8da51
RELEASE-NOTES: synced 2022-12-30 16:06:03 +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
54120efdf6
transfer: break the read loop when RECV is cleared
When the RECV bit is cleared because the response reading for this
transfer is complete, the read loop should be stopped. data_pending()
can otherwise still return TRUE and another read would be attempted.

Reported-by: Hide Ishikawa
Fixes #10172
Closes #10174
2022-12-30 09:20:55 +01:00
Daniel Stenberg
1c00796039
multihandle: turn bool struct fields into bits
Closes #10179
2022-12-30 00:16:53 +01:00
Stefan Eissing
b0119436b0
ftpserver: lower the normal DATA connect timeout to speed up torture tests
- tests/ftpserver.pl blocks when expecting a DATA connection from the
  client.

- the previous 10 seconds were encountered repeatedly in torture tests
  and let to long waits.

- 2 seconds should still be sufficient for current hw, but CI will show.

Closes #10178
2022-12-30 00:13:56 +01:00
Nick Banks
ae98b85020
msh3: add support for request payload
Closes #10136
2022-12-28 13:52:58 +01:00
Stefan Eissing
f39472ea9f
openssl: remove attached easy handles from SSL instances
- keeping the "current" easy handle registered at SSL* is no longer
   necessary, since the "calling" data object is already stored in the
   cfilter's context (and used by other SSL backends from there).
 - The "detach" of an easy handle that goes out of scope is then avoided.
 - using SSL_set0_wbio for clear reference counting where available.

Closes #10151
2022-12-28 13:30:05 +01:00
Daniel Stenberg
7fa449ca0c
socketpair: allow localhost MITM sniffers
Windows allow programs to MITM connections to localhost. The previous
check here would detect that and error out. This new method writes data
to verify the pipe thus allowing MITM.

Reported-by: SerusDev on github
Fixes #10144
Closes #10169
2022-12-28 09:27:02 +01:00
Daniel Stenberg
5ab72b9a57
HTTP3: mention what needs to be in place to remove EXPERIMENTAL label
Closes #10168
2022-12-28 09:20:12 +01:00
andy5995
54130a6cad
MANUAL.md: add pipe to apt-key example
Closes #10170
2022-12-28 09:19:02 +01:00
Daniel Stenberg
01b6afd8d9
test417: verify %{certs} output 2022-12-27 22:41:19 +01:00
Daniel Stenberg
d9ee0e47c1
runtests: make 'mbedtls' a testable feature
Also add to FILEFORMAT.md
2022-12-27 22:41:19 +01:00
Daniel Stenberg
c6aa19c1da
writeout: add %{certs} and %{num_certs}
Let users get the server certificate chain using the command line

Closes #10019
2022-12-27 22:41:17 +01:00
Stefan Eissing
db5f833cc7
haxproxy: send before TLS handhshake
- reverse order of haproxy and final ssl cfilter

- make haproxy avaiable on PROXY builds, independent of HTTP support as
  it can be used with any protocol.

Reported-by: Sergio-IME on github
Fixes #10165
Closes #10167
2022-12-27 16:06:43 +01:00
Daniel Stenberg
1971a861bd
RELEASE-NOTES: synced 2022-12-27 15:38:47 +01:00
Daniel Stenberg
ea5aaaa5ed
test446: verify hsts with two URLs 2022-12-27 15:22:32 +01:00
Daniel Stenberg
dc0725244a
runtests: support crlf="yes" for verify/proxy 2022-12-27 15:22:32 +01:00
Daniel Stenberg
ca02a77f05
hsts: handle adding the same host name again
It will then use the largest expire time of the two entries.
2022-12-27 15:22:32 +01:00
Daniel Stenberg
0bf8b796a0
tool_operate: share HSTS between handles 2022-12-27 15:22:01 +01:00
Daniel Stenberg
076a2f6291
share: add sharing of HSTS cache among handles
Closes #10138
2022-12-27 15:22:01 +01:00
Viktor Szakats
692c73707a
Makefile.mk: fix wolfssl and mbedtls default paths
Fix the defaults for `WOLFSSL_PATH` and `MBEDTLS_PATH` to have
meaningful values instead of the copy-pasted wrong ones.

Ref: 66e68ca47f (r94275172)

Reported-by: Ryan Schmidt
Closes #10164
2022-12-27 11:36:03 +00:00
Daniel Stenberg
9566372a8d
INTERNALS: cleanup
- remove "operating systems" (mostly outdated)

- upodate the "build tools"

Closes #10162
2022-12-27 10:54:03 +01:00
Daniel Stenberg
dfbe035c8b
cmake: bump requirement to 3.7
Because this is the cmake version (released in November 2016) that
introduced GREATER_EQUAL, which is used already.

Reported-by: nick-telia on github
Fixes #10128
Closes #10161
2022-12-27 10:52:34 +01:00
Daniel Stenberg
728400f875
cfilters:Curl_conn_get_select_socks: use the first non-connected filter
When there are filters addded for both socket and SSL, the code
previously checked the SSL sockets during connect when it *should* first
check the socket layer until that has connected.

Fixes #10157
Fixes #10146
Closes #10160

Reviewed-by: Stefan Eissing
2022-12-27 10:48:29 +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
cf174810db
RELEASE-NOTES: synced 2022-12-26 10:56:49 +01:00
Daniel Stenberg
ccf1ca9430
libssh2: try sha2 algos for hostkey methods
As is supported by recent libssh2, but should just be ignored by older
versions.

Reported-by: norbertmm on github
Assisted-by: norbertmm on github
Fixes #10143
Closes #10145
2022-12-26 10:15:48 +01:00
Patrick Monnerat
e2aed00430
typecheck: accept expressions for option/info parameters
As expressions can have side effects, evaluate only once.

To enable deprecation reporting only once, get rid of the __typeof__
use to define the local temporary variable and use the target type
(CURLoption/CURLINFO). This also avoids multiple reports on type
conflicts (if some) by the curlcheck_* macros.

Note that CURLOPT_* and CURLINFO_* symbols may be deprecated, but not
their values: a curl_easy_setopt call with an integer constant as option
will never report a deprecation.

Reported-by: Thomas Klausner
Fixes #10148
Closes #10149
2022-12-26 10:04:55 +01:00
Paul Howarth
ef07452a5c
tests: avoid use of sha1 in certificates
The SHA-1 algorithm is deprecated (particularly for security-sensitive
applications) in a variety of OS environments. This already affects
RHEL-9 and derivatives, which are not willing to use certificates using
that algorithm. The fix is to use sha256 instead, which is already used
for most of the other certificates in the test suite.

Fixes #10135

This gets rid of issues related to sha1 signatures.

Manual steps after "make clean-certs" and "make build-certs":

- Copy tests/certs/stunnel-sv.pem to tests/stunnel.pem
  (make clean-certs does not remove the original tests/stunnel.pem)

- Copy tests/certs/Server-localhost-sv.pubkey-pinned into --pinnedpubkey
  options of tests/data/test2041 and tests/data/test2087

Closes #10153
2022-12-26 09:47:43 +01:00
Yurii Rashkovskii
5ee81c3963
cmake: fix the snprintf detection
I haven't had the time to check other configurations, but on my macOS
Ventura 13.1 with XCode 14.2 cmake does not find `snprintf`.

Solution: ensure stdio.h is checked for definitions

Closes #10155
2022-12-26 09:32:37 +01:00
Radu Hociung
73477d5a4d
http: remove the trace message "Mark bundle... multiuse"
The message "Mark bundle as not supporting multiuse" was added at commit
29364d93 when an http/2-related bug was fixed, and it appears to be a
leftover trace message.

This message should be removed because:
 * it conveys no information to the user
 * it is enabled in the default build (--enable-verbose)
 * it reads like a warning/unexpected condition
 * it is equivalent to "Detected http proto < 2", which is
   not a useful message.
 * it is a time-wasting red-herring for anyone who encounters
   it for the first time while investigating some other, real
   problem.

This commit removes the trace message "Mark bundle as not
supporting multiuse"

Closes #10159
2022-12-26 09:29:36 +01:00
Hannah Schierling
a5cf4a87cf
url: fix build with --disable-cookies
Struct `UserDefined` has no member `cookielist` if
`CURL_DISABLE_COOKIES` is defined.

Follow-up to af5999a

Closes #10158
2022-12-26 09:27:39 +01:00
Stefan Eissing
4ab601d93a
runtests: also tear down http2/http3 servers when https server is stopped
Closes #10114
2022-12-23 08:56:53 +01:00
Stefan Eissing
c7fb341c0e
tests: add 3 new HTTP/2 test cases, plus https: support for nghttpx
- a simple https get
- a simple https post
- a multi get of 4 requests and check that same connection was used

Closes #10114
2022-12-23 08:56:53 +01:00
Daniel Stenberg
db07301fbb
urldata: remove unused struct fields, made more conditional
- source_quote, source_prequote and source_postquote have not been used since
  5e0d9aea3; September 2006

- make several fields conditional on proxy support

- make three quote struct fields conditional on FTP || SSH

- make 'mime_options' depend on MIME

- make trailer_* fields depend on HTTP

- change 'gssapi_delegation' from long to unsigned char

- make 'localportrange' unsigned short instead of int

- conn->trailer now depends on HTTP

Closes #10147
2022-12-23 08:45:05 +01:00