You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/02/03 14:10:08 UTC

[GitHub] [cassandra] smiklosovic commented on a change in pull request #1316: CASSANDRA-17031: Add support for PEM formatted key material for the SSL context

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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org