HTTPS SSL实现

This commit is contained in:
egan
2017-09-23 23:11:48 +08:00
parent 00e70a53c7
commit 09420f32ed
4 changed files with 34 additions and 4 deletions

View File

@@ -42,8 +42,10 @@ public class ApyAccount {
private String seller;
//请求证书地址,请使用绝对路径
// @Column(name = "keystore_path")
private String keystorePath;
//证书对应的密码
// @Column(name = "store_password")
private String storePassword;

View File

@@ -51,7 +51,7 @@ public class PayResponse {
//根据不同的账户类型 初始化支付配置
this.service = apyAccount.getPayType().getPayService(apyAccount);
this.storage = service.getPayConfigStorage();
//这里设置代理配置
//这里设置http请求配置
// service.setRequestTemplateConfigStorage(getHttpConfigStorage());
buildRouter(apyAccount.getPayId());
}
@@ -75,7 +75,9 @@ public class PayResponse {
httpConfigStorage.setHttpProxyPassword("password");
*/
//设置ssl证书路径
httpConfigStorage.setKeystorePath(apyAccount.getKeystorePath());
//设置ssl证书对应的密码
httpConfigStorage.setStorePassword(apyAccount.getStorePassword());
return httpConfigStorage;
}

View File

@@ -16,6 +16,8 @@ CREATE TABLE `pay_account` (
`input_charset` VARCHAR(16) DEFAULT NULL COMMENT '枚举值,字符编码 utf-8,gbk等等',
`pay_type` CHAR(16) DEFAULT NULL COMMENT '支付类型,aliPay支付宝wxPay微信, youdianPay: 友店微信,此处开发者自定义对应com.egzosn.pay.demo.entity.PayType枚举值',
`msg_type` CHAR(8) DEFAULT NULL COMMENT '消息类型text,xml,json',
`keystore_path` VARCHAR(256) DEFAULT NULL COMMENT '请求证书地址,请使用绝对路径',
`store_password` VARCHAR(256) DEFAULT NULL COMMENT '证书对应的密码',
`is_test` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否为测试环境',
`create_by` CHAR(32) DEFAULT NULL COMMENT '创建人',
`create_time` TIMESTAMP NULL DEFAULT NULL COMMENT '创建时间',