diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-01-29 05:55:50 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-01-29 05:55:50 +0000 |
commit | 167ed8f193d7d80bc23ecd82c80f8143e74d4ec4 (patch) | |
tree | b4daa8950fb21ffc66a65af3b6423f115ce94cab /plugins/check_http.c | |
parent | e2e676c45fd1d65153669eddb50e9384d00670cd (diff) | |
download | monitoring-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
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 15 |
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) | |||
541 | char *x = NULL; | 541 | char *x = NULL; |
542 | char *orig_url = NULL; | 542 | char *orig_url = NULL; |
543 | double elapsed_time; | 543 | double elapsed_time; |
544 | #ifdef HAVE_SSL | ||
545 | int sslerr; | ||
546 | #endif | ||
544 | 547 | ||
545 | /* try to connect to the host at the given port number */ | 548 | /* try to connect to the host at the given port number */ |
546 | #ifdef HAVE_SSL | 549 | #ifdef HAVE_SSL |
@@ -674,8 +677,18 @@ check_http (void) | |||
674 | pagesize += i; | 677 | pagesize += i; |
675 | } | 678 | } |
676 | 679 | ||
677 | if (i < 0) | 680 | if (i < 0) { |
681 | #ifdef HAVE_SSL | ||
682 | sslerr=SSL_get_error(ssl, i); | ||
683 | if ( sslerr == SSL_ERROR_SSL ) { | ||
684 | terminate (STATE_WARNING, "Client Certificate Required\n"); | ||
685 | } else { | ||
686 | terminate (STATE_CRITICAL, "Error in recv()"); | ||
687 | } | ||
688 | #else | ||
678 | terminate (STATE_CRITICAL, "Error in recv()"); | 689 | terminate (STATE_CRITICAL, "Error in recv()"); |
690 | #endif | ||
691 | } | ||
679 | 692 | ||
680 | /* return a CRITICAL status if we couldn't read any data */ | 693 | /* return a CRITICAL status if we couldn't read any data */ |
681 | if (pagesize == (size_t) 0) | 694 | if (pagesize == (size_t) 0) |