Module: monitoring-plugins
 Branch: master
 Commit: 8bc1d57a7348afc4da80a60c37c971f51ae72a26
 Author: Alvar Penning <[email protected]>
   Date: Thu Dec 11 22:16:53 2025 +0100
    URL: 
https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=8bc1d57a

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.

---

 plugins/check_http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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) {
                        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;

Reply via email to