chromy96 commented on code in PR #11916:
URL: https://github.com/apache/kafka/pull/11916#discussion_r862845752
##########
clients/src/test/java/org/apache/kafka/common/security/ssl/DefaultSslEngineFactoryTest.java:
##########
@@ -291,7 +289,14 @@ public void testPemKeyStoreFileNoKeyPassword() throws
Exception {
configs.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG,
pemFilePath(pemAsConfigValue(KEY, CERTCHAIN).value()));
configs.put(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG,
DefaultSslEngineFactory.PEM_TYPE);
- assertThrows(InvalidConfigurationException.class, () ->
factory.configure(configs));
+ configs.put(SslConfigs.SSL_KEY_PASSWORD_CONFIG, null);
+ factory.configure(configs);
+
+ KeyStore keyStore = factory.keystore();
+ List<String> aliases = Collections.list(keyStore.aliases());
+ assertEquals(Collections.singletonList("kafka"), aliases);
+ assertNotNull(keyStore.getCertificate("kafka"), "Certificate not
loaded");
+ assertNotNull(keyStore.getKey("kafka", null), "Private key not
loaded");
Review Comment:
Thanks for the comment. Fixed
--
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]