Kaynağa Gözat

Merge branch 'master' of github.com:nagios-plugins/nagios-plugins

Sebastian Wolf 3 yıl önce
ebeveyn
işleme
024e34f0b4
1 değiştirilmiş dosya ile 6 ekleme ve 5 silme
  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);
 			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);
                     result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit);
 		    smtp_quit();
 		    smtp_quit();
 		    my_close();
 		    my_close();
 		    return result;
 		    return result;
 		  }
 		  }
-#  endif /* USE_OPENSSL */
-		}
-#endif
+#endif /* USE_OPENSSL */
 
 
 		if (send_mail_from) {
 		if (send_mail_from) {
 		  my_send(cmd_str, strlen(cmd_str));
 		  my_send(cmd_str, strlen(cmd_str));