Skip to content

Commit 9c0efd4

Browse files
committed
Changes to support selection of appropriate alias from a keystore with multiple alias entries
1 parent 7779764 commit 9c0efd4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

clients/src/main/java/org/apache/kafka/common/security/ssl/DefaultSslEngineFactory.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,14 @@ public char[] keyPassword() {
454454
*/
455455
protected KeyStore load(boolean isKeyStore) {
456456
try (InputStream in = Files.newInputStream(Paths.get(path))) {
457-
KeyStore ks = KeyStore.getInstance(type);
458-
// If a password is not set access to the truststore is still available, but integrity checking is disabled.
459-
char[] passwordChars = password != null ? password.value().toCharArray() : null;
460-
ks.load(in, passwordChars);
461-
return ks;
462-
} catch (GeneralSecurityException | IOException e) {
463-
throw new KafkaException("Failed to load SSL keystore " + path + " of type " + type, e);
464-
}
457+
KeyStore ks = KeyStore.getInstance(type);
458+
// If a password is not set access to the truststore is still available, but integrity checking is disabled.
459+
char[] passwordChars = password != null ? password.value().toCharArray() : null;
460+
ks.load(in, passwordChars);
461+
return ks;
462+
} catch (GeneralSecurityException | IOException e) {
463+
throw new KafkaException("Failed to load SSL keystore " + path + " of type " + type, e);
464+
}
465465
}
466466

467467
private Long lastModifiedMs(String path) {

0 commit comments

Comments
 (0)