Skip to content

Commit 9eba04d

Browse files
authored
🎨 【微信支付】初始化v3客户端时,未使用p12证书且未设置证书序列号值才尝试加载证书
1 parent 25e0d78 commit 9eba04d

File tree

1 file changed

+2
-4
lines changed
  • weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config

1 file changed

+2
-4
lines changed

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,13 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
281281
merchantPrivateKey = PemUtils.loadPrivateKey(keyInputStream);
282282

283283
}
284-
if (certificate == null) {
284+
if (certificate == null && StringUtils.isBlank(this.getCertSerialNo())) {
285285
InputStream certInputStream = this.loadConfigInputStream(this.getPrivateCertString(), this.getPrivateCertPath(),
286286
this.privateCertContent, "privateCertPath");
287287
certificate = PemUtils.loadCertificate(certInputStream);
288-
}
289-
290-
if (StringUtils.isBlank(this.getCertSerialNo())) {
291288
this.certSerialNo = certificate.getSerialNumber().toString(16).toUpperCase();
292289
}
290+
293291
//构造Http Proxy正向代理
294292
WxPayHttpProxy wxPayHttpProxy = getWxPayHttpProxy();
295293

0 commit comments

Comments
 (0)