瀏覽代碼

加密测试1

wangjun 1 月之前
父節點
當前提交
8f2556b2f5
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      code/base/nckd-jimin-base-helper/src/main/java/nckd/base/helper/FileSECUtils.java

+ 4 - 4
code/base/nckd-jimin-base-helper/src/main/java/nckd/base/helper/FileSECUtils.java

@@ -21,9 +21,9 @@ import org.apache.http.impl.client.HttpClients;
 import javax.net.ssl.SSLContext;
 
 import java.io.*;
-import java.net.HttpURLConnection;
-import java.net.URL;
+
 import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
 import java.text.DecimalFormat;
 import java.util.List;
 import java.util.Map;
@@ -208,8 +208,8 @@ public class FileSECUtils {
 
     private static CloseableHttpClient buildSSLCloseableHttpClient() throws Exception {
         SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
-            @Override
-            public boolean isTrusted(java.security.cert.X509Certificate[] x509Certificates, String s) throws CertificateException {
+            // 信任所有
+            public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                 return true;
             }
         }).build();