Skip to content

Commit

Permalink
[fix][client] Fix load the trust store file
Browse files Browse the repository at this point in the history
  • Loading branch information
nodece committed Feb 14, 2023
1 parent b969fe5 commit 413a3aa
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -159,8 +159,10 @@ public SSLContext createSSLContext() throws GeneralSecurityException, IOExceptio
: TrustManagerFactory.getInstance(tmfAlgorithm);
KeyStore trustStore = KeyStore.getInstance(trustStoreTypeString);
char[] passwordChars = trustStorePassword.toCharArray();
try (FileInputStream inputStream = new FileInputStream(trustStorePath)) {
trustStore.load(inputStream, passwordChars);
if (!Strings.isNullOrEmpty(trustStorePath)) {
try (FileInputStream inputStream = new FileInputStream(trustStorePath)) {
trustStore.load(inputStream, passwordChars);
}
}
trustManagerFactory.init(trustStore);
}
Expand Down

0 comments on commit 413a3aa

Please sign in to comment.