Skip to content

Commit

Permalink
✨ 代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunMengLu committed Nov 16, 2024
1 parent df7a76e commit 3aa9dfa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ public static Pair<SSLContext, X509TrustManager> getSslContext(InputStream keySt
KeyManager[] kms = null;
TrustManager[] tms = null;
if (keyStoreInputStream != null) {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
KeyStore keyStore = KeyStore.getInstance("JKS");
char[] keyPassChars = keyPass == null ? null : keyPass.toCharArray();
keyStore.load(keyStoreInputStream, keyPassChars);
Expand All @@ -737,7 +737,7 @@ private static TrustManager[] getTrustManagers(InputStream trustInputStream, cha
if (trustInputStream == null) {
return new TrustManager[]{DisableValidationTrustManager.INSTANCE};
} else {
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance("SunX509");
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
KeyStore keyStore = KeyStore.getInstance("JKS");
keyStore.load(trustInputStream, trustPassword);
trustManagerFactory.init(keyStore);
Expand Down

0 comments on commit 3aa9dfa

Please sign in to comment.