Commit Graph

31089 Commits

Author SHA1 Message Date
Daniel Stenberg
463528b0f8
wolfssl: ignore errors in CA path
The default wolfSSL_CTX_load_verify_locations() function is quite picky
with the certificates it loads and will for example return error if just
one of the certs has expired.

With the *_ex() function and its WOLFSSL_LOAD_FLAG_IGNORE_ERR flag, it
behaves more similar to what OpenSSL does by default.

Even the set of default certs on my Debian unstable has several expired
ones.

Assisted-by: Juliusz Sosinowicz
Assisted-by: Michael Osipov

Closes #11987
2023-09-30 11:19:38 +02:00
Daniel Stenberg
5bbe732d20
create-dirs.d: clarify it also uses --output-dirs
Reported-by: Robert Simpson
Fixes #11991
Closes #11995
2023-09-30 10:15:54 +02:00
Viktor Szakats
a1d73a6bbf
appveyor: fix yamlint issues, indent
Also:
- use double quotes in all batch if statements.

Closes #11994
2023-09-30 07:05:54 +00:00
Viktor Szakats
da5dcb7007
cmake: detect HAVE_CLOCK_GETTIME_MONOTONIC_RAW
Based on existing autotools logic.

Ref: #11964 (effort to sync cmake detections with autotools)

Closes #11981
2023-09-29 18:30:34 +00:00
Viktor Szakats
04a3a377d8
cmake: detect HAVE_GETADDRINFO_THREADSAFE
Based on existing autotools logic.

autotools checks for old versions of the allowlisted target OSes and
disables this feature when seeing them. In CMake we assume we're running
on newer systems and enable regardless of OS version.

autotools always runs all 3 probes for non-fast-tracked systems and
enables this feature if any one of them was successful. To save
configuration time,  CMake stops at the first successful check.

OpenBSD is not fast-tracked and then gets blocklisted as a generic BSD
system. I haven't double-checked if this is correct, but looks odd.

Ref: #11964 (effort to sync cmake detections with autotools)

Closes #11979
2023-09-29 18:30:34 +00:00
Viktor Szakats
ca7daadd9b
cmake: fix HAVE_WRITABLE_ARGV detection
Move detection before the creation of detection results in
`curl_config.h`.

Ref: #11964 (effort to sync cmake detections with autotools)

Closes #11978
2023-09-29 18:29:55 +00:00
Viktor Szakats
69aa8f6de4
appveyor: minor improvements
- run `curl -V` after builds to see if they run and with what features.
  Except for one job where a CRT DLL is missing. And ARM64 which should
  fail, but is silently not launched instead.

- copy libcurl DLL next to curl tool and tests binaries in shared mode.
  This makes it possible to run the tests. (We don't run tests after
  these builds yet.)

- list the DLLs and EXEs present after the builds.

- add `DEBUG` variable for CMake builds to allow disabling it, for
  testing non-debug builds. (currently enabled for all)

- add commented lines that dump CMake configuration logs for debugging
  build/auto-detection issues.

- add gcc version to jobs where missing.

- switch a job to the native MSYS2 mingw-w64 toolchain. This adds gcc 9
  to the build mix.

- make `SHARED=OFF` and `OPENSSL=OFF` defaults global.

- delete a duplicate backslash.

Closes #11976
2023-09-29 18:27:47 +00:00
Viktor Szakats
1e8c7fac42
configure: replace adhoc domain with localhost in tests
Reviewed-by: Daniel Stenberg
Closes #11988
2023-09-29 18:25:59 +00:00
Viktor Szakats
1bc69df7b4
tidy-up: use more example domains
Also make use of the example TLD:
https://en.wikipedia.org/wiki/.example

Reviewed-by: Daniel Stenberg
Closes #11992
2023-09-29 18:25:56 +00:00
Dan Fandrich
65729f65c7 runtests: display the test status if tests appear hung
It sometimes happens that a test hangs during a test run and never
returns. The test harness will wait indefinitely for the results and on
CI servers the CI job will eventually be killed after an hour or two.
At the end of a test run, if results haven't come in within a couple of
minutes, display the status of all test runners and what tests they're
running to help in debugging the problem.

This feature is really only kick in with parallel testing enabled, which
is fine because without parallel testing it's usually easy to tell what
test has hung.

Closes #11980
2023-09-29 08:58:52 -07:00
Dan Fandrich
5c006df36c github/labeler: remove workaround for labeler
This was added due to what seemed to be a bug regarding the sync-labels:
config option, but it looks like it wasn't necessary.

Follow-up to b2b0534e7
2023-09-29 08:58:52 -07:00
Viktor Szakats
ecdde58c14
docs: upgrade an URL to HTTPS in BINDINGS.md [ci skip] 2023-09-29 12:15:41 +00:00
Daniel Stenberg
21498a168e
docs: replace made up domains with example.com
in FAQ and MANUAL.md

- example.com was made for this purpose.

- reduces the risk that one of those domains suddenly start hosting
  something nasty and we provide links to them

Closes #11986
2023-09-29 13:49:43 +02:00
Michael Osipov
4266dd9684
acinclude.m4: Document proper system truststore on FreeBSD
The default system truststore on FreeBSD has been /etc/ssl/certs for many
years now. It is managed canonically through certctl(8) and contains hashed
symlinks for OpenSSL and other TLS providers.
The previous ones require security/ca_root_nss which might not be installed or
will not contain any custom CA certificates.

Closes #11985
2023-09-29 13:19:43 +02:00
Daniel Stenberg
1afc8a7df0
FAQ: How do I upgrade curl.exe in Windows?
This is a growing question, better answer it here to get somewhere to
point users to.

Closes #11984
2023-09-29 13:11:17 +02:00
Viktor Szakats
14b745608b
cmake: pre-cache HAVE_BASENAME for mingw-w64 and MSVC
`basename` is present in mingw-w64, missing from MSVC. Pre-cache
accordingly to make configure faster.

Notice that `basename` has a bug so we later disable it even with
mingw-w64:
781242ffa4/lib/curl_setup.h (L820-L825)

Closes #11974
2023-09-28 21:33:55 +00:00
Daniel Stenberg
9b517c8b69
cmake: add missing checks
- check for arc4random. To make rand.c use it accordingly.
- check for fcntl
- fix fseek detection
- add SIZEOF_CURL_SOCKET_T
- fix USE_UNIX_SOCKETS
- define HAVE_SNPRINTF to 1
- check for fnmatch
- check for sched_yield
- remove HAVE_GETPPID duplicate from curl_config.h
- add HAVE_SENDMSG

Ref: #11964

Co-authored-by: Viktor Szakats
Closes #11973
2023-09-28 23:00:43 +02:00
Daniel Stenberg
2ba804942f
configure: remove unused checks
- for sys/uio.h
- for fork
- for connect

Ref: #11964

Closes #11973
2023-09-28 23:00:39 +02:00
Daniel Stenberg
db07376a3e
lib: remove TIME_WITH_SYS_TIME
It is not used in any code anywhere.

Ref: #11964
Closes #11975
2023-09-28 22:58:36 +02:00
Daniel Stenberg
f11a5d2c5a
docs: update curl man page references
Detected by the manpage-syntax update

Closes #11963
2023-09-28 22:57:24 +02:00
Daniel Stenberg
2b8937ce3a
manpage-syntax: verify curl man page references
1. References to curl symbols are now checked that they indeed exist as
   man pages. This for \f references as well as the names referenced in the
   SEE ALSO section.

   Allowlist curl.1 since it is not always built in builds

2. References to curl symbols that lack section now causes warning, since that
   will prevent them from getting linked properly

3. Check for "bare" references to curl functions and warn, they should be
   references

Closes #11963
2023-09-28 22:57:22 +02:00
Daniel Stenberg
290622cea6
cmake: add check for suseconds_t
And fix the HAVE_LONGLONG define

Ref: #11964
Closes #11977
2023-09-28 22:56:24 +02:00
Viktor Szakats
a8c773845f
tidy-up: whitespace fixes
Closes #11972
2023-09-28 12:03:28 +00:00
Viktor Szakats
781242ffa4
cmake: detect TLS-SRP in OpenSSL/wolfSSL/GnuTLS
With new option `CURL_DISABLE_SRP=ON` to force-disable it.
To match existing option and detection logic in autotools.

Also:
- fix detecting GnuTLS.
  We assume `nettle` as a GnuTLS dependency.
- add CMake GnuTLS CI job.
- bump AppVeyor CMake OpenSSL MSVC job to OpenSSL 1.1.1 (from 1.0.2)
  TLS-SRP fails to detect with 1.0.2 due to an OpenSSL header bug.
- fix compiler warning when building with GnuTLS and disabled TLS-SRP.
- fix comment typos, whitespace.

Ref: #11964

Closes #11967
2023-09-28 10:50:56 +00:00
Viktor Szakats
e5bb88b8f8
tool: use our own stderr variable
Earlier this year we changed our own stderr variable to use the standard
name `stderr` (to avoid bugs where someone is using `stderr` instead of
the curl-tool specific variable). This solution needed to override the
standard `stderr` symbol via the preprocessor. This in turn didn't play
well with unity builds and caused curl tool to crash or stay silent due
to an uninitialized stderr. This was a hard to find issue, fixed by
manually breaking out one file from the unity sources.

To avoid two these two tricks, this patch implements a different
solution: Restore using our own local variable for our stderr output and
leave `stderr` as-is. To avoid using `stderr` by mistake, add a
`checksrc` rule (based on logic we already used in lib for `strerror`)
that detects any `stderr` use in `src` and points to using our own
variable instead: `tool_stderr`.

Follow-up to 06133d3e9b
Follow-up to 2f17a9b654

Closes #11958
2023-09-28 10:50:56 +00:00
Loïc Yhuel
b5bb84cbef
connect: only start the happy eyeballs timer when needed
The timeout is only used when there is a second address family, for the
delayed eyeballer.

Closes #11939
2023-09-28 10:21:32 +02:00
Daniel Stenberg
a35e2dd69c
tool_operate: free 'gateway' correctly
Pointed out by Coverity. The fix in 93885cf3a8 was incomplete.

Also removed repeated wording in IPFS related error messages.

Closes #11969
2023-09-28 10:14:38 +02:00
Stefan Eissing
0bd9e137e3
lib: move handling of data->req.writer_stack into Curl_client_write()
- move definitions from content_encoding.h to sendf.h
- move create/cleanup/add code into sendf.c
- installed content_encoding writers will always be called
  on Curl_client_write(CLIENTWRITE_BODY)
- Curl_client_cleanup() frees writers and tempbuffers from
  paused transfers, irregardless of protocol

Closes #11908
2023-09-28 10:00:13 +02:00
Loïc Yhuel
d39863d27a
multi: round the timeout up to prevent early wakeups
Curl_timediff rounds down to the millisecond, so curl_multi_perform can
be called too early, then we get a timeout of 0 and call it again.

The code already handled the case of timeouts which expired less than
1ms in the future.  By rounding up, we make sure we will never ask the
platform to wake up too early.

Closes #11938
2023-09-28 09:52:20 +02:00
Daniel Stenberg
5a904a6938
RELEASE-NOTES: spell out that IPFS is via gateway 2023-09-28 09:49:43 +02:00
Daniel Stenberg
915949e89c
RELEASE-NOTES: synced 2023-09-28 09:42:52 +02:00
Daniel Stenberg
c50cbac0f0
tool_operate: avoid strlen() -1 on zero length content from file
Follow-up to 65b563a96a

Closes #11959
2023-09-28 09:24:57 +02:00
Daniel Stenberg
93885cf3a8
tool_operate: fix memory mixups
Switch to plain getenv() from curl_getenv() to avoid the allocation and
having to keep track of which free() or curl_free() that need to be
used.

Coverity found issues and a memory leak.

Follow-up to 65b563a96a

Closes #11959
2023-09-28 09:24:57 +02:00
Viktor Szakats
a7f8d04ee0
curl-functions.m4: fixup recent bad edits
Follow-up to 96c29900bc #11940

Closes #11966
2023-09-27 12:58:49 +00:00
Daniel Stenberg
d14089df01
curl-functions.m4: fix include line
This made the getaddrinfo detection fail, but we did not spot it in the
CI because it graciously falled back to using legacy functions instead!

Follow-up to 96c29900bc (#11940)

Closes #11965
2023-09-27 14:38:42 +02:00
Daniel Stenberg
1f92db87e0
inet_ntop: add typecast to silence Coverity
CID 1024653:  Integer handling issues  (SIGN_EXTENSION)

Suspicious implicit sign extension: "src[i]" with type "unsigned char
const" (8 bits, unsigned) is promoted in "src[i] << (1 - i % 2 << 3)" to
type "int" (32 bits, signed), then sign-extended to type "unsigned long"
(64 bits, unsigned).  If "src[i] << (1 - i % 2 << 3)" is greater than
0x7FFFFFFF, the upper bits of the result will all be 1.

111         words[i/2] |= (src[i] << ((1 - (i % 2)) << 3));

The value will not be greater than 0x7FFFFFFF so this still cannot
happen.

Also, switch to ints here instead of longs. The values stored are 16 bit
so at least no need to use 64 bit variables. Also, longs are 32 bit on
some platforms so this logic still needs to work with 32 bits.

Closes #11960
2023-09-27 13:18:22 +02:00
Daniel Stenberg
bb50368ef8
docs: adapt SEE ALSO sections to new requirements
To please manpage-syntax.pl used by test 1173

Closes #11957
2023-09-27 10:40:32 +02:00
Daniel Stenberg
7000a0e067
manpage-syntax.pl: verify SEE ALSO syntax
- Enforce a single reference per .BR line
- Skip the quotes around the section number for example (3)
- Insist on trailing commas on all lines except the last
- Error on comma on the last SEE ALSO entry

- List the entries alpha-sorted, not enforced just recommended

Closes #11957
2023-09-27 10:40:23 +02:00
Daniel Stenberg
01d8473b25
connect: expire the timeout when trying next
... so that it gets called again immediately and can continue trying
addresses to connect to. Otherwise it might unnecessarily wait for a
while there.

Fixes #11920
Reported-by: Loïc Yhuel
Closes #11935
2023-09-27 10:35:36 +02:00
Daniel Stenberg
afb4b15614
http: remove wrong comment for http_should_fail
Reported-by: Christian Schmitz
Ref: #11936
Closes #11941
2023-09-27 09:15:03 +02:00
Dan Fandrich
f0f421b468 tool_setopt: remove unused function tool_setopt_flags
This function is identical to tool_setopt_bitmask except that it treats
the argument as unsigned.

Closes #11943
2023-09-26 17:55:11 -07:00
Viktor Szakats
1411c5eb33
cmake: add feature checks for memrchr and getifaddrs
- `HAVE_MEMRCHR` for `memrchr`.
- `HAVE_GETIFADDRS` for `getifaddrs`.
  This was present in `lib/curl_config.h.cmake` but missed the detection
  logic.

To match existing autotools feature checks.

Closes #11954
2023-09-26 22:10:28 +00:00
Viktor Szakats
3795fcde99
cmake: move global headers to specific checks
Before this patch we added standard headers unconditionally to the
global list of headers used for feature checks. This is unnecessary
and also doesn't help CMake 'Generate' performance. This patch moves
these headers to each feature check where they are actually needed.
Stop using `stddef.h`, as it seems unnecessary.

I've used autotools' `m4/curl-functions.m4` to figure out these
dependencies.

Also delete checking for the C89 standard header `time.h`, that I
missed in the earlier commit.

Ref: 96c29900bc #11940

Closes #11951
2023-09-26 22:09:47 +00:00
Viktor Szakats
9567c7ef12
src/mkhelp: make generated code pass checksrc
Closes #11955
2023-09-26 22:09:21 +00:00
Viktor Szakats
7370a7c760
tests: show which curl tool runtests.pl is using
To help debugging when there is issue finding or running it.

Closes #11953
2023-09-26 22:09:11 +00:00
Viktor Szakats
64896fefd0
CI/azure: make MAKEFLAGS global to parallelize all jobs
https://dev.azure.com/daniel0244/curl/_build/results?buildId=17528 (before)
https://dev.azure.com/daniel0244/curl/_build/results?buildId=17545 (after, with -j3)

Closes #11952
2023-09-26 22:08:39 +00:00
Viktor Szakats
cf8f6c04df
CI/azure: migrate old mingw MSYS1 jobs to MSYS2
Also delete an accidental variable reference.

Follow-up to 38029101e2

Closes #11945
2023-09-26 22:08:24 +00:00
Daniel Stenberg
8547ae56fa
docs: add see also curl_multi_get_handles to some man pages
Assisted-by: Jay Satiro

Closes #11942
2023-09-26 23:30:50 +02:00
Viktor Szakats
8e74c0729d
cmake: assume _fseeki64 and no fseeko on Windows
`_fseeki64` is present in mingw-w64 1.0 (2011-09-26) headers, and
at least Watcom C 1.9 (2010) headers and MSVS 2008 [1].

`fseeko` is not present in any of these.

(mingw-w64 1.0 also offers `fseeko64`.)

[1] https://github.com/curl/curl/pull/11944#issuecomment-1734995004

Follow-up to 9c7165e96a #11918

Closes #11950
2023-09-26 14:26:13 +00:00
Viktor Szakats
96c29900bc
build: delete checks for C89 standard headers
Delete checks and guards for standard C89 headers and assume these are
available: `stdio.h`, `string.h`, `time.h`, `setjmp.h`, `stdlib.h`,
`stddef.h`, `signal.h`.

Some of these we already used unconditionally, some others we only used
for feature checks.

Follow-up to 9c7165e96a #11918 (for `stdio.h` in CMake)

Closes #11940
2023-09-26 14:25:10 +00:00