mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-06-02 14:00:51 +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证书文件
|
||||
|
||||
@@ -62,8 +62,9 @@ public enum PayType implements BasePayType {
|
||||
configStorage.setMsgType(apyAccount.getMsgType());
|
||||
configStorage.setInputCharset(apyAccount.getInputCharset());
|
||||
configStorage.setTest(apyAccount.isTest());
|
||||
//
|
||||
HttpConfigStorage httpConfigStorage = new HttpConfigStorage();
|
||||
httpConfigStorage.setMaxTotal(10);
|
||||
httpConfigStorage.setMaxTotal(20);
|
||||
httpConfigStorage.setDefaultMaxPerRoute(10);
|
||||
return new AliPayService(configStorage, httpConfigStorage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user