mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-05 17:38:05 +08:00
🎨 初始化v3客户端时,未设置证书序列号值才尝试加载证书
This commit is contained in:
parent
7bbe805cb4
commit
13f9c64643
@ -262,12 +262,12 @@ public class WxPayConfig {
|
|||||||
|
|
||||||
InputStream keyInputStream = this.loadConfigInputStream(this.getPrivateKeyString(), this.getPrivateKeyPath(),
|
InputStream keyInputStream = this.loadConfigInputStream(this.getPrivateKeyString(), this.getPrivateKeyPath(),
|
||||||
this.privateKeyContent, "privateKeyPath");
|
this.privateKeyContent, "privateKeyPath");
|
||||||
InputStream certInputStream = this.loadConfigInputStream(this.getPrivateCertString(), this.getPrivateCertPath(),
|
|
||||||
this.privateCertContent, "privateCertPath");
|
|
||||||
try {
|
try {
|
||||||
PrivateKey merchantPrivateKey = PemUtils.loadPrivateKey(keyInputStream);
|
PrivateKey merchantPrivateKey = PemUtils.loadPrivateKey(keyInputStream);
|
||||||
X509Certificate certificate = PemUtils.loadCertificate(certInputStream);
|
|
||||||
if (StringUtils.isBlank(this.getCertSerialNo())) {
|
if (StringUtils.isBlank(this.getCertSerialNo())) {
|
||||||
|
InputStream certInputStream = this.loadConfigInputStream(this.getPrivateCertString(), this.getPrivateCertPath(),
|
||||||
|
this.privateCertContent, "privateCertPath");
|
||||||
|
X509Certificate certificate = PemUtils.loadCertificate(certInputStream);
|
||||||
this.certSerialNo = certificate.getSerialNumber().toString(16).toUpperCase();
|
this.certSerialNo = certificate.getSerialNumber().toString(16).toUpperCase();
|
||||||
}
|
}
|
||||||
//构造Http Proxy正向代理
|
//构造Http Proxy正向代理
|
||||||
@ -290,6 +290,8 @@ public class WxPayConfig {
|
|||||||
this.privateKey = merchantPrivateKey;
|
this.privateKey = merchantPrivateKey;
|
||||||
|
|
||||||
return httpClient;
|
return httpClient;
|
||||||
|
} catch (WxPayException e) {
|
||||||
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new WxPayException("v3请求构造异常!", e);
|
throw new WxPayException("v3请求构造异常!", e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user