diff --git a/src/main/java/org/opensearch/security/ssl/config/SslCertificatesLoader.java b/src/main/java/org/opensearch/security/ssl/config/SslCertificatesLoader.java index a3f0c39eed..f3959bb946 100644 --- a/src/main/java/org/opensearch/security/ssl/config/SslCertificatesLoader.java +++ b/src/main/java/org/opensearch/security/ssl/config/SslCertificatesLoader.java @@ -62,6 +62,7 @@ public Tuple loadConfiguration(f final var settings = environment.settings(); final var sslConfigSettings = settings.getByPrefix(fullSslConfigSuffix); if (settings.hasValue(sslConfigSuffix + KEYSTORE_FILEPATH)) { + final var keyStorePassword = resolvePassword(sslConfigSuffix + KEYSTORE_PASSWORD, settings, DEFAULT_STORE_PASSWORD); return Tuple.tuple( environment.settings().hasValue(sslConfigSuffix + TRUSTSTORE_FILEPATH) ? buildJdkTrustStoreConfiguration( @@ -73,8 +74,12 @@ public Tuple loadConfiguration(f buildJdkKeyStoreConfiguration( sslConfigSettings, environment, - resolvePassword(sslConfigSuffix + KEYSTORE_PASSWORD, settings, DEFAULT_STORE_PASSWORD), - resolvePassword(fullSslConfigSuffix + KEYSTORE_KEY_PASSWORD, settings, DEFAULT_STORE_PASSWORD) + keyStorePassword, + resolvePassword( + fullSslConfigSuffix + KEYSTORE_KEY_PASSWORD, + settings, + keyStorePassword != null ? String.valueOf(keyStorePassword) : null + ) ) ); } else {