summaryrefslogtreecommitdiffstats
path: root/web/attachments/31133-check_http.diff
blob: 1e80479ca8f09c00d2dac775d438ee3db29efec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- check_http.c	Thu Feb 28 07:42:57 2002
+++ /root/check_http.c	Sat Sep 14 22:51:21 2002
@@ -529,6 +529,9 @@
 	size_t pagesize = 0;
 	char *full_page = NULL;
 	char *pos = NULL;
+#ifdef HAVE_SSL
+	int sslerr;
+#endif
 
 	/* try to connect to the host at the given port number */
 #ifdef HAVE_SSL
@@ -660,8 +663,18 @@
 		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)