smiklosovic commented on a change in pull request #1316:
URL: https://github.com/apache/cassandra/pull/1316#discussion_r798600144
##########
File path:
src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java
##########
@@ -178,10 +173,29 @@ protected TrustManagerFactory buildTrustManagerFactory()
throws SSLException
}
}
+ protected boolean checkExpiredCerts(KeyStore ks) throws KeyStoreException
+ {
+ boolean hasExpiredCerts = false;
+ for (Enumeration<String> aliases = ks.aliases();
aliases.hasMoreElements(); )
+ {
+ String alias = aliases.nextElement();
+ if (ks.getCertificate(alias).getType().equals("X.509"))
+ {
+ Date expires = ((X509Certificate)
ks.getCertificate(alias)).getNotAfter();
+ if (expires.before(new Date()))
Review comment:
Could not this be instantiated just once? final Date date = new Date();
outside of whole for loop. If there is 500 aliases, we will do 500x "new
Date()".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]