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.

b8a6b3cae5

However, even if "die" now checks for NULL, a human readable error is
nice to have.
This commit is contained in:
Alvar Penning 2025-12-11 22:16:53 +01:00
parent 7ab5b3ba34
commit 8bc1d57a73
No known key found for this signature in database

View file

@ -1036,7 +1036,7 @@ int check_http(void) {
printf("SSL initialized\n");
}
if (result != STATE_OK) {
die(STATE_CRITICAL, NULL);
die(STATE_CRITICAL, _("HTTP CRITICAL - SSL error\n"));
}
microsec_ssl = deltime(tv_temp);
elapsed_time_ssl = (double)microsec_ssl / 1.0e6;