|
19 | 19 | import java.io.IOException;
|
20 | 20 | import java.nio.file.Path;
|
21 | 21 | import java.security.GeneralSecurityException;
|
| 22 | +import java.security.KeyStore; |
22 | 23 | import java.util.ArrayList;
|
23 | 24 | import java.util.List;
|
24 | 25 | import java.util.Objects;
|
@@ -194,9 +195,9 @@ private static KeyConfig createKeyConfig(Settings settings, SSLConfiguration glo
|
194 | 195 | if (System.getProperty("javax.net.ssl.keyStore") != null) {
|
195 | 196 | // TODO: we should not support loading a keystore from sysprops...
|
196 | 197 | try (SecureString keystorePassword = new SecureString(System.getProperty("javax.net.ssl.keyStorePassword", ""))) {
|
197 |
| - return new StoreKeyConfig(System.getProperty("javax.net.ssl.keyStore"), "jks", keystorePassword, keystorePassword, |
198 |
| - System.getProperty("ssl.KeyManagerFactory.algorithm", KeyManagerFactory.getDefaultAlgorithm()), |
199 |
| - System.getProperty("ssl.TrustManagerFactory.algorithm", TrustManagerFactory.getDefaultAlgorithm())); |
| 198 | + return new StoreKeyConfig(System.getProperty("javax.net.ssl.keyStore"), KeyStore.getDefaultType(), keystorePassword, |
| 199 | + keystorePassword, System.getProperty("ssl.KeyManagerFactory.algorithm", KeyManagerFactory.getDefaultAlgorithm()), |
| 200 | + System.getProperty("ssl.TrustManagerFactory.algorithm", TrustManagerFactory.getDefaultAlgorithm())); |
200 | 201 | }
|
201 | 202 | }
|
202 | 203 | return KeyConfig.NONE;
|
@@ -234,7 +235,7 @@ private static TrustConfig createCertChainTrustConfig(Settings settings, KeyConf
|
234 | 235 | return new StoreTrustConfig(trustStorePath, trustStoreType, trustStorePassword, trustStoreAlgorithm);
|
235 | 236 | } else if (global == null && System.getProperty("javax.net.ssl.trustStore") != null) {
|
236 | 237 | try (SecureString truststorePassword = new SecureString(System.getProperty("javax.net.ssl.trustStorePassword", ""))) {
|
237 |
| - return new StoreTrustConfig(System.getProperty("javax.net.ssl.trustStore"), "jks", truststorePassword, |
| 238 | + return new StoreTrustConfig(System.getProperty("javax.net.ssl.trustStore"), KeyStore.getDefaultType(), truststorePassword, |
238 | 239 | System.getProperty("ssl.TrustManagerFactory.algorithm", TrustManagerFactory.getDefaultAlgorithm()));
|
239 | 240 | }
|
240 | 241 | } else if (global != null && keyConfig == global.keyConfig()) {
|
|
0 commit comments