Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-4248 Log Expired certificates from cacerts.jks with level warning #4297

Merged
merged 1 commit into from
Nov 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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