Skip to content

Commit

Permalink
Merge pull request #4297 from rdebusscher/PAYARA-4248
Browse files Browse the repository at this point in the history
PAYARA-4248 Log Expired certificates from cacerts.jks with level warning
  • Loading branch information
MarkWareham authored Nov 7, 2019
2 parents 6bb7d73 + 2e51fd6 commit 73a463e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import static java.util.Arrays.copyOf;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.FINEST;
import static java.util.logging.Level.SEVERE;
import static java.util.logging.Level.WARNING;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
Expand Down Expand Up @@ -118,7 +118,7 @@ public class SecuritySupportImpl extends SecuritySupport {

protected static final Logger _logger = Logger.getLogger(SEC_SSL_LOGGER, SHARED_LOGMESSAGE_RESOURCE);

@LogMessageInfo(message = "The SSL certificate has expired: {0}", level = "SEVERE", cause = "Certificate expired.", action = "Check the expiration date of the certicate.")
@LogMessageInfo(message = "The SSL certificate has expired: {0}", level = "WARNING", cause = "Certificate expired.", action = "Check the expiration date of the certificate.")
private static final String SSL_CERT_EXPIRED = "NCLS-SECURITY-05054";

private static final String DEFAULT_KEYSTORE_PASS = "changeit";
Expand Down Expand Up @@ -569,7 +569,7 @@ private void checkCertificateDates(KeyStore keyStore) throws KeyStoreException {
Certificate certificate = keyStore.getCertificate(aliases.nextElement());
if (certificate instanceof X509Certificate) {
if (((X509Certificate) certificate).getNotAfter().before(initDate)) {
_logger.log(SEVERE, SSL_CERT_EXPIRED, certificate);
_logger.log(WARNING, SSL_CERT_EXPIRED, certificate);
}
}
}
Expand Down

0 comments on commit 73a463e

Please sign in to comment.