Skip to content

Commit

Permalink
Use system property to get SSL algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
Arshardh committed May 9, 2024
1 parent 60de95c commit 668eb2c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static SSLContext createServerSSLContext(final String keyStoreLocation,
KeyStore keyStore = KeyStore.getInstance(KEY_STORE_TYPE);
keyStore.load(new FileInputStream(keyStoreLocation), keyStorePwd.toCharArray());
KeyManagerFactory keyManagerFactory =
KeyManagerFactory.getInstance(KEY_MANAGER_TYPE);
KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyManagerFactory.init(keyStore, keyStorePwd.toCharArray());
serverSSLCtx = SSLContext.getInstance(PROTOCOL);
serverSSLCtx.init(keyManagerFactory.getKeyManagers(), null, null);
Expand Down Expand Up @@ -85,7 +85,7 @@ public static SSLContext createClientSSLContext(final String trustStoreLocation,
trustStore.load(new FileInputStream(trustStoreLocation),
trustStorePwd.toCharArray());
TrustManagerFactory trustManagerFactory =
TrustManagerFactory.getInstance(TRUST_MANAGER_TYPE);
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(trustStore);
clientSSLCtx = SSLContext.getInstance(PROTOCOL);
clientSSLCtx.init(null, trustManagerFactory.getTrustManagers(), null);
Expand Down Expand Up @@ -116,7 +116,7 @@ public static TrustManagerFactory createTrustmanager(final String trustStoreLoca
KeyStore trustStore = KeyStore.getInstance(TRUST_STORE_TYPE);
trustStore.load(new FileInputStream(trustStoreLocation),
trustStorePwd.toCharArray());
trustManagerFactory = TrustManagerFactory.getInstance(TRUST_MANAGER_TYPE);
trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(trustStore);
// clientSSLCtx = SSLContext.getInstance(PROTOCOL);
// clientSSLCtx.init(null,
Expand Down

0 comments on commit 668eb2c

Please sign in to comment.