You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/04/29 15:42:59 UTC
[GitHub] [kafka] dajac commented on a diff in pull request #11916: KAFKA-12703; Allow unencrypted private keys when using PEM files
dajac commented on code in PR #11916:
URL: https://github.com/apache/kafka/pull/11916#discussion_r861926282
##########
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:
nit: There is an extra space before `null`.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org