mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-09 12:36:16 +08:00
ssl证书未设置处理
This commit is contained in:
@@ -27,6 +27,7 @@ import java.io.*;
|
||||
import java.net.URI;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.KeyStore;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -101,7 +102,11 @@ public class HttpRequestTemplate {
|
||||
public SSLConnectionSocketFactory createSSL( HttpConfigStorage configStorage){
|
||||
|
||||
if (StringUtils.isEmpty(configStorage.getKeystore())){
|
||||
return null;
|
||||
try {
|
||||
return new SSLConnectionSocketFactory(SSLContext.getDefault());
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//读取本机存放的PKCS12证书文件
|
||||
|
||||
Reference in New Issue
Block a user