🎨 【微信支付】初始化v3客户端时,未使用p12证书且未设置证书序列号值才尝试加载证书

This commit is contained in:
Liu 2024-10-17 00:16:36 +08:00 committed by GitHub
parent 25e0d780b1
commit 9eba04dce9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -281,15 +281,13 @@ public class WxPayConfig {
merchantPrivateKey = PemUtils.loadPrivateKey(keyInputStream);
}
if (certificate == null) {
if (certificate == null && StringUtils.isBlank(this.getCertSerialNo())) {
InputStream certInputStream = this.loadConfigInputStream(this.getPrivateCertString(), this.getPrivateCertPath(),
this.privateCertContent, "privateCertPath");
certificate = PemUtils.loadCertificate(certInputStream);
}
if (StringUtils.isBlank(this.getCertSerialNo())) {
this.certSerialNo = certificate.getSerialNumber().toString(16).toUpperCase();
}
//构造Http Proxy正向代理
WxPayHttpProxy wxPayHttpProxy = getWxPayHttpProxy();