diff --git a/mica-http/src/main/java/net/dreamlu/mica/http/HttpRequest.java b/mica-http/src/main/java/net/dreamlu/mica/http/HttpRequest.java index 704a49b8f..7b4e894d4 100644 --- a/mica-http/src/main/java/net/dreamlu/mica/http/HttpRequest.java +++ b/mica-http/src/main/java/net/dreamlu/mica/http/HttpRequest.java @@ -712,7 +712,7 @@ public static Pair 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); @@ -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);