Commit graph

147 commits

Author SHA1 Message Date
waja
265a7c0ed8
Merge branch 'master' into compiler_warning_part_2 2023-06-28 16:39:27 +02:00
Lorenz Kästle
b96a8424f0 Avoid unnecessary malloc and use stack instead 2023-04-26 09:15:04 +02:00
RincewindsHat
d271819149 Fixes for -Wrestrict 2023-04-18 00:20:39 +02:00
RincewindsHat
907b933a87 Fixes for -Wunused-parameters 2023-04-18 00:20:12 +02:00
RincewindsHat
f7687d47cb Fixes for -Wimplicit-fallthrough 2023-04-18 00:18:07 +02:00
RincewindsHat
6c78f0b5ea Fixes for -Wunused
* lib/utils_base.c
* plugins/check_curl.c
* plugins-root/check_dhcp.c
   Removed a line which theoretically can not do anything, but there was
   comment which indicated something else. Still trying this though.
2023-04-18 00:13:24 +02:00
Jan Wagner
0f3703e641 Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
Andreas Baumann
cf90f0de7b check_curk: including netinet/in.h (for FreeBSD), fixed an ambigous compare warning 2023-03-16 16:21:46 +01:00
Andreas Baumann
ea53555f2d check_curl: removed a superflous variable 2023-03-11 11:40:00 +01:00
Andreas Baumann
fc927e98db fixed a wrong compare and a wrong size in strncat 2023-03-08 16:10:45 +01:00
Barak Shohat
2902381c5d check_curl.c: Include all IPs from getaddrinfo() in curl DNS cache 2023-03-08 11:56:43 +02:00
Andreas Baumann
03f86b5d08 check_curl: in SSL host caching mode try to connect and bind and take the first getaddrinfo result which succeeds 2023-03-07 19:51:33 +01:00
Andreas Baumann
ad6b638acb using real boolean in check_curl 2023-02-17 14:03:55 +01:00
Andreas Baumann
8e1bbf5e6e changed #else/#if to #elif in libcurl library checks 2023-02-12 15:09:02 +01:00
Andreas Baumann
6563267c3a fixed double frees when doing old-style redirects 2023-02-12 13:16:25 +01:00
Andreas Baumann
40da85e691 better cleanup of curl structures and buffers 2023-02-12 12:11:38 +01:00
Andreas Baumann
f6978deaa1 added --cookie-jar and doing proper cleanup of libcurl 2023-02-11 19:11:07 +01:00
Andreas Baumann
27b0c69645 fixed regerror is MAX_INPUT_BUFFER writting into too small errbuf 2023-02-11 18:39:24 +01:00
Andreas Baumann
53f07a468d using CURLOPT_REDIR_PROTOCOLS_STR instead of CURLOPT_REDIR_PROTOCOLS for curl >= 7.85.0 2023-02-05 20:34:41 +01:00
waja
72147140ed
Fixing spelling errors (#1826) 2023-01-17 15:42:54 +01:00
Sven Nierlein
765b29f09b
check_curl: fix checking large bodys (#1823)
check_curl fails on large pages:

  HTTP CRITICAL - Invalid HTTP response received from host on port 5080: cURL returned 23 - Failure writing output to destination

for example trying to run check_curl on the test from #1822

I guess the idea is to double the buffer size each time it is to small. But the code
exponentially grows the buffer size which works well 2-3 times, but then fails.
2022-12-22 12:51:18 +01:00
Lorenz
4a5ddd2011
Check curl detect ipv6 (#1809)
* If server_address is an IPv6 address surround it with brackets

* If the message is too short, we should not have an underflow

* Add simple conditional test case available if IPv6 is
2022-11-07 17:48:28 +01:00
Andreas Baumann
a96bdd7349 check_curl: added option --continue-after-certificate (#1761) 2022-04-10 16:31:53 +02:00
Andreas Baumann
ee2a60fc4e fixed -ffollow for HTTP/2.0 (Fixes #1685): added major_version parsing to PicoHTTPParser 2022-01-29 12:17:37 +01:00
Andreas Baumann
737412f739 check_http and check_curl: added --max-redirs=N option (feature #1684) 2022-01-29 12:15:12 +01:00
RincewindsHat
ad45727dbe
Merge pull request #1688 from bazzisoft/master
check_curl.c: bugfix: verify certificates option should not force SSL to be used
2021-11-17 17:57:00 +01:00
Andreas Baumann
de5503063e check_curl: fixed a potential buffer overflow in retir/uri_string 2021-07-25 18:49:06 +02:00
Andreas Baumann
3f5c54c783 check_curl: fixed DNS caching for SSL hostnames (avoid CURLOPT_RESOLVE entry errors) 2021-07-25 18:39:07 +02:00
Andreas Baumann
6e696643a5 check_curl: changed to STATE_CRITICAL for infinite loops (-ffollow) 2021-07-04 18:43:42 +02:00
Andreas Baumann
0b6838ffca fix for missing X509_up_ref on old systems with only OpenSSL 1.0 2021-06-24 17:08:20 +00:00
Andreas Baumann
20e9451fad added option --enable-automatic-decompression 2021-06-24 11:02:28 +02:00
Andreas Baumann
beb609ffcf check_curl:
- added verbose output in verify_callback
- pin refcounting for certs (avoid subject extraction error when checking
  certs in is_openssl_callback mode)
2021-05-27 15:32:08 +02:00
Barak Shohat
63cb7ecfcf check_curl.c: bugfix: verify certificates option should not force SSL to be used 2021-05-24 14:53:58 +03:00
Barak Shohat
f0ac7fcc7c check_curl: Fix bug where headers beginning with HTTP_ cause the status line parsing to fail. 2021-04-13 12:06:18 +02:00
Andreas Baumann
cd358cd08a check_curl: backported --show-body/-B to print body (from check_http) 2021-04-08 20:39:48 +02:00
Andreas Baumann
1debd29b57 check_curl: make -C obvious (from check_http, part 2) 2021-04-08 15:14:53 +02:00
Andreas Baumann
a6acea7941 check_curl: make -C obvious (from check_http) 2021-04-08 14:15:54 +02:00
Andreas Baumann
f90aec83cb check_curl: Increase regexp limit (to 1024 as in check_http) 2021-04-08 14:07:20 +02:00
Sven Nierlein
f6fd14e886
Merge pull request #1669 from bazzisoft/verify-cert
Add an option to check_curl to verify the peer certificate & host using the system CA's
2021-04-07 17:51:38 +02:00
Barak Shohat
6993c21695 Add an option to check_curl to verify the peer certificate & host using the system CA's 2021-04-07 15:38:47 +03:00
Sven Nierlein
1033724797
Merge pull request #1668 from bazzisoft/master
Update check_curl.c to display a specific human-readable error message where possible
2021-04-07 11:49:10 +02:00
Barak Shohat
2482950e26 Updated check_curl.c to display a specific human-readable error message where possible 2021-04-07 12:36:55 +03:00
Sven Nierlein
2e5b38cc83
Merge pull request #1666 from sni/check_curl_fix_header_parser
fix check_curl crash if http header contains leading spaces
2021-04-07 10:30:31 +02:00
Sven Nierlein
5cfc93d995 fix check_curl crash if http header contains leading spaces
check_curl crashes when a (broken) http server returns invalid http header with
leading spaces or double colons. This PR adds a fix and a test case for this.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2021-03-11 13:33:16 +01:00
Andreas Baumann
0f926a3566 check_curl: added string_statuscode function for printing HTTP/1.1 and HTTP/2 correctly 2021-03-08 19:46:43 +01:00
Andreas Baumann
d9a5d1faf0 check_curl: fixed a potential buffer overflow in url buffer 2021-01-19 18:35:41 +01:00
Andreas Baumann
ede8defad4 check_curl: fixed help, usage and errors for TLS 1.3 2021-01-19 18:32:27 +01:00
Sven Nierlein
772fb233b9 check_curl: host_name may be null
for example when using like: ./check_curl localhost
2020-05-18 14:08:45 +02:00
Sven Nierlein
84fd9ae893 check_curl: use CURLOPT_RESOLVE to fix connecting to the right ip
when using ssl, the composed url contains the hostname instead of the specified
ip. So use CURLOPT_RESOLVE to make curl still connect to the ip.
2020-05-18 13:43:17 +02:00
Sven Nierlein
8a64e47083 check_curl: clean trailing whitespace 2020-05-18 11:30:34 +02:00