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/338743-check_http.revert-SNI.patch | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 web/attachments/338743-check_http.revert-SNI.patch (limited to 'web/attachments/338743-check_http.revert-SNI.patch') diff --git a/web/attachments/338743-check_http.revert-SNI.patch b/web/attachments/338743-check_http.revert-SNI.patch new file mode 100644 index 0000000..d19f2f1 --- /dev/null +++ b/web/attachments/338743-check_http.revert-SNI.patch @@ -0,0 +1,63 @@ +diff --git a/plugins/check_http.c b/plugins/check_http.c +index 0310203..79f6adf 100644 +--- a/plugins/check_http.c ++++ b/plugins/check_http.c +@@ -790,7 +790,7 @@ check_http (void) + die (STATE_CRITICAL, _("HTTP CRITICAL - Unable to open TCP socket\n")); + #ifdef HAVE_SSL + if (use_ssl == TRUE) { +- np_net_ssl_init(sd); ++ np_net_ssl_init_with_hostname(sd, host_name); + if (check_cert == TRUE) { + result = np_net_ssl_check_cert(days_till_exp); + np_net_ssl_cleanup(); +diff --git a/plugins/netutils.h b/plugins/netutils.h +index b479b74..572a3ae 100644 +--- a/plugins/netutils.h ++++ b/plugins/netutils.h +@@ -99,6 +99,7 @@ extern int address_family; + #ifdef HAVE_SSL + /* maybe this could be merged with the above np_net_connect, via some flags */ + int np_net_ssl_init(int sd); ++int np_net_ssl_init_with_hostname(int sd, char *host_name); + void np_net_ssl_cleanup(); + int np_net_ssl_write(const void *buf, int num); + int np_net_ssl_read(void *buf, int num); +diff --git a/plugins/sslutils.c b/plugins/sslutils.c +index 1d4ef94..aa571b6 100644 +--- a/plugins/sslutils.c ++++ b/plugins/sslutils.c +@@ -35,7 +35,11 @@ static SSL_CTX *c=NULL; + static SSL *s=NULL; + static int initialized=0; + +-int np_net_ssl_init (int sd){ ++int np_net_ssl_init (int sd) { ++ return np_net_ssl_init_with_hostname(sd, NULL); ++} ++ ++int np_net_ssl_init_with_hostname (int sd, char *host_name) { + if (!initialized) { + /* Initialize SSL context */ + SSLeay_add_ssl_algorithms (); +@@ -48,6 +52,10 @@ int np_net_ssl_init (int sd){ + return STATE_CRITICAL; + } + if ((s = SSL_new (c)) != NULL){ ++#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; +@@ -65,6 +73,9 @@ int np_net_ssl_init (int sd){ + + void np_net_ssl_cleanup (){ + if(s){ ++#ifdef SSL_set_tlsext_host_name ++ SSL_set_tlsext_host_name(s, NULL); ++#endif + SSL_shutdown (s); + SSL_free (s); + if(c) { -- cgit v1.2.3-74-g34f1