From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/388024-sslutils.patch | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 web/attachments/388024-sslutils.patch (limited to 'web/attachments/388024-sslutils.patch') diff --git a/web/attachments/388024-sslutils.patch b/web/attachments/388024-sslutils.patch new file mode 100644 index 0000000..417c6be --- /dev/null +++ b/web/attachments/388024-sslutils.patch @@ -0,0 +1,59 @@ +--- plugins/sslutils.c 2010-07-27 16:47:16.000000000 -0400 ++++ sslutils.c 2010-09-27 10:16:20.000000000 -0400 +@@ -51,24 +51,40 @@ + printf ("%s\n", _("CRITICAL - Cannot create SSL context.")); + return STATE_CRITICAL; + } +- if ((s = SSL_new (c)) != NULL){ ++ if ((s = SSL_new (c)) == NULL){ ++ printf ("%s\n", _("CRITICAL - Cannot initiate SSL handshake.")); ++ return STATE_CRITICAL; ++ } + #ifdef SSL_set_tlsext_host_name +- if (host_name != NULL) +- SSL_set_tlsext_host_name(s, host_name); ++ if (host_name != NULL) ++ SSL_set_tlsext_host_name(s, host_name); + #endif +- SSL_set_fd (s, sd); +- if (SSL_connect(s) == 1){ +- return OK; +- } else { +- printf ("%s\n", _("CRITICAL - Cannot make SSL connection ")); +-# ifdef USE_OPENSSL /* XXX look into ERR_error_string */ +- ERR_print_errors_fp (stdout); +-# endif /* USE_OPENSSL */ +- } +- } else { +- printf ("%s\n", _("CRITICAL - Cannot initiate SSL handshake.")); +- } +- return STATE_CRITICAL; ++ SSL_set_fd (s, sd); ++ if (SSL_connect(s) == 1) ++ return OK; ++ ++ // Try TLS ++ // Free old pointers ++ SSL_CTX_free(c); ++ SSL_free(s); ++ ++ if ((c = SSL_CTX_new(TLSv1_client_method())) == NULL) { ++ printf("%s\n", _("CRITICAL - Cannot create SSL context.")); ++ return STATE_CRITICAL; ++ } ++ if ((s = SSL_new(c)) == NULL) { ++ printf("%s\n", _("CRITICAL - Cannot initiate SSL handshake.")); ++ return STATE_CRITICAL; ++ } ++#ifdef SSL_set_tlsext_host_name ++ if (host_name != NULL) ++ SSL_set_tlsext_host_name(s, host_name); ++#endif ++ SSL_set_fd(s, sd); ++ if (SSL_connect(s) == 1){ ++ return OK; ++ } ++ return STATE_CRITICAL; + } + + void np_net_ssl_cleanup (){ -- cgit v1.2.3-74-g34f1