From 3aa9dfa1423b89566b7ae23ebfdfe5d6051a4347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=A2=A6=E6=8A=80=E6=9C=AF?= <596392912@qq.com> Date: Sat, 16 Nov 2024 09:24:29 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/net/dreamlu/mica/http/HttpRequest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);