Browse Source

Permit certificate check with both --ssl and --starttls (fixes #651)

Ryan Allgaier 3 năm trước cách đây
mục cha
commit
377b5683c7
1 tập tin đã thay đổi với 6 bổ sung5 xóa
  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));