frankgh commented on code in PR #43:
URL: 
https://github.com/apache/cassandra-analytics/pull/43#discussion_r1509704327


##########
cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/validation/KeyStoreValidationTests.java:
##########
@@ -97,4 +98,15 @@ public void testValidKeyStore()
         Throwable throwable = validation.perform();
         assertNull(throwable);
     }
+
+    @Test
+    public void testExpiredKeyStore()
+    {
+        SecretsProvider secrets = TestSecretsProvider.forKeyStore("PKCS12", 
"keystore-expired.p12", "qwerty");
+        KeyStoreValidation validation = new KeyStoreValidation(secrets);
+
+        Throwable throwable = validation.perform();
+        assertInstanceOf(RuntimeException.class, throwable);
+        assertThat(throwable.getMessage()).startsWith("Certificate expired, 
valid NotAfter: ");

Review Comment:
   the error message is odd, Should we just say:
   
   `Certificate expired. NotAfter:` instead?



##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/validation/KeyStoreValidation.java:
##########
@@ -81,6 +85,15 @@ public void validate()
                 throw new RuntimeException("KeyStore is empty");
             }
 
+            for (Enumeration<String> aliases = keyStore.aliases(); 
aliases.hasMoreElements();)
+            {
+                Certificate cert = 
keyStore.getCertificate(aliases.nextElement());
+                if (cert instanceof X509Certificate && !(cert instanceof 
PemX509Certificate))

Review Comment:
   I don't think we need to worry about `PemX509Certificate`s.



-- 
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: commits-unsubscr...@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to