Skip to content

Commit

Permalink
Merge pull request #1714 from Arshardh/bny-ssl-fix-main
Browse files Browse the repository at this point in the history
Use system property to get SSL algorithm
  • Loading branch information
arunans23 authored Jul 11, 2024
2 parents 3d95991 + 668eb2c commit d85f038
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 d85f038

Please sign in to comment.