Explorar el Código

Merge pull request #672 from ryanallgaier/fix-issue-651

check_smtp: Permit certificate check with both --ssl and --starttls
Sebastian Wolf hace 3 años
padre
commit
6bbee1fc8b
Se han modificado 1 ficheros con 6 adiciones y 5 borrados
  1. 6 5
      plugins/check_smtp.c

+ 6 - 5
plugins/check_smtp.c

@@ -311,16 +311,17 @@ main (int argc, char **argv)
 			printf("%s", buffer);
 		}
 
-#  ifdef USE_OPENSSL
-		  if ( check_cert ) {
+		}
+#endif
+
+#ifdef USE_OPENSSL
+		if ( (use_ssl || use_starttls) && check_cert ) {
                     result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit);
 		    smtp_quit();
 		    my_close();
 		    return result;
 		  }
-#  endif /* USE_OPENSSL */
-		}
-#endif
+#endif /* USE_OPENSSL */
 
 		if (send_mail_from) {
 		  my_send(cmd_str, strlen(cmd_str));