summaryrefslogtreecommitdiffstats
path: root/plugins/check_http.c
diff options
context:
space:
mode:
authorAlvar Penning <post@0x21.biz>2025-12-11 22:16:53 +0100
committerAlvar Penning <post@0x21.biz>2025-12-11 22:27:12 +0100
commit8bc1d57a7348afc4da80a60c37c971f51ae72a26 (patch)
treefe5f367debccd2218e87c63f0eb898ca6282d1c2 /plugins/check_http.c
parent7ab5b3ba34128949902cb966ab73d84f8fb4113f (diff)
downloadmonitoring-plugins-8bc1d57a7348afc4da80a60c37c971f51ae72a26.tar.gz
check_http: Abort invalid SSL w/ error
If a SSL connection cannot be established, check_http bailed out with a die function call with a NULL fmt string. This adds a more meaningful message. The motivation for this patch was to get everything from the OpenBSD ports upstream. It seems like in the old days, this would have resulted in a segfault. https://codeberg.org/OpenBSD/ports/commit/b8a6b3cae57bbfd67e667dca583c621d45ab0d6f However, even if "die" now checks for NULL, a human readable error is nice to have.
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r--plugins/check_http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index d264b95d..d2f080c7 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1036,7 +1036,7 @@ int check_http(void) {
1036 printf("SSL initialized\n"); 1036 printf("SSL initialized\n");
1037 } 1037 }
1038 if (result != STATE_OK) { 1038 if (result != STATE_OK) {
1039 die(STATE_CRITICAL, NULL); 1039 die(STATE_CRITICAL, _("HTTP CRITICAL - SSL error\n"));
1040 } 1040 }
1041 microsec_ssl = deltime(tv_temp); 1041 microsec_ssl = deltime(tv_temp);
1042 elapsed_time_ssl = (double)microsec_ssl / 1.0e6; 1042 elapsed_time_ssl = (double)microsec_ssl / 1.0e6;