Ver Fonte

removed conditional 'if result != ok' for certificate checking

Bryan Heden há 8 anos atrás
pai
commit
80ec842a89
2 ficheiros alterados com 5 adições e 6 exclusões
  1. 4 5
      plugins/check_http.c
  2. 1 1
      plugins/sslutils.c

+ 4 - 5
plugins/check_http.c

@@ -1030,11 +1030,10 @@ check_http (void)
         elapsed_time_ssl = (double)microsec_ssl / 1.0e6;
         if (check_cert == TRUE) {
             result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit);
-            if (result != STATE_OK) {
-                if (sd) close(sd);
-                np_net_ssl_cleanup();
-                return result;
-            }
+            if (sd) 
+                close(sd);
+            np_net_ssl_cleanup();
+            return result;
         }
     }
 #endif /* HAVE_SSL */

+ 1 - 1
plugins/sslutils.c

@@ -316,7 +316,7 @@ int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
 		else
 			status = STATE_CRITICAL;
 	} else {
-		printf(_("OK - Certificate '%s' will expire on %s. "), cn, timestamp);
+		printf(_("OK - Certificate '%s' will expire on %s.\n"), cn, timestamp);
 		status = STATE_OK;
 	}
 	X509_free(certificate);