mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-06-01 21:40:26 +08:00
HTTPS SSL实现
This commit is contained in:
@@ -40,6 +40,13 @@ public class ApyAccount {
|
||||
// 收款账号
|
||||
// @Column(name = "seller")
|
||||
private String seller;
|
||||
|
||||
//请求证书地址,请使用绝对路径
|
||||
private String keystorePath;
|
||||
//证书对应的密码
|
||||
private String storePassword;
|
||||
|
||||
|
||||
// 签名类型
|
||||
// @Column(name = "sign_type")
|
||||
private String signType;
|
||||
@@ -156,6 +163,22 @@ public class ApyAccount {
|
||||
return isTest;
|
||||
}
|
||||
|
||||
public String getKeystorePath() {
|
||||
return keystorePath;
|
||||
}
|
||||
|
||||
public void setKeystorePath(String keystorePath) {
|
||||
this.keystorePath = keystorePath;
|
||||
}
|
||||
|
||||
public String getStorePassword() {
|
||||
return storePassword;
|
||||
}
|
||||
|
||||
public void setStorePassword(String storePassword) {
|
||||
this.storePassword = storePassword;
|
||||
}
|
||||
|
||||
public void setTest(boolean test) {
|
||||
isTest = test;
|
||||
}
|
||||
|
||||
@@ -57,12 +57,14 @@ public class PayResponse {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取http配置,如果配置为null则为默认配置,无代理。
|
||||
* 此处非必需
|
||||
* @return
|
||||
* 获取http配置,如果配置为null则为默认配置,无代理,无证书的请求方式。
|
||||
* 此处非必需
|
||||
* @param apyAccount 账户信息
|
||||
* @return 请求配置
|
||||
*/
|
||||
public HttpConfigStorage getHttpConfigStorage(){
|
||||
public HttpConfigStorage getHttpConfigStorage(ApyAccount apyAccount){
|
||||
HttpConfigStorage httpConfigStorage = new HttpConfigStorage();
|
||||
/*
|
||||
//http代理地址
|
||||
httpConfigStorage.setHttpProxyHost("192.168.1.69");
|
||||
//代理端口
|
||||
@@ -71,6 +73,10 @@ public class PayResponse {
|
||||
httpConfigStorage.setHttpProxyUsername("user");
|
||||
//代理密码
|
||||
httpConfigStorage.setHttpProxyPassword("password");
|
||||
|
||||
*/
|
||||
httpConfigStorage.setKeystorePath(apyAccount.getKeystorePath());
|
||||
httpConfigStorage.setStorePassword(apyAccount.getStorePassword());
|
||||
return httpConfigStorage;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user