aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-01-29 05:55:50 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-01-29 05:55:50 +0000
commit167ed8f193d7d80bc23ecd82c80f8143e74d4ec4 (patch)
treeb4daa8950fb21ffc66a65af3b6423f115ce94cab
parente2e676c45fd1d65153669eddb50e9384d00670cd (diff)
downloadmonitoring-plugins-167ed8f193d7d80bc23ecd82c80f8143e74d4ec4.tar.gz
Better error if server requests client based certificate (609382 - Olaf Greis)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@265 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_http.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 506a1ec7..daddfc19 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -541,6 +541,9 @@ check_http (void)
char *x = NULL;
char *orig_url = NULL;
double elapsed_time;
+#ifdef HAVE_SSL
+ int sslerr;
+#endif
/* try to connect to the host at the given port number */
#ifdef HAVE_SSL
@@ -674,8 +677,18 @@ check_http (void)
pagesize += i;
}
- if (i < 0)
+ if (i < 0) {
+#ifdef HAVE_SSL
+ sslerr=SSL_get_error(ssl, i);
+ if ( sslerr == SSL_ERROR_SSL ) {
+ terminate (STATE_WARNING, "Client Certificate Required\n");
+ } else {
+ terminate (STATE_CRITICAL, "Error in recv()");
+ }
+#else
terminate (STATE_CRITICAL, "Error in recv()");
+#endif
+ }
/* return a CRITICAL status if we couldn't read any data */
if (pagesize == (size_t) 0)