File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -295,13 +295,13 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
295
295
this .certSerialNo = certificate .getSerialNumber ().toString (16 ).toUpperCase ();
296
296
}
297
297
try {
298
- if (merchantPrivateKey == null ) {
298
+ if (merchantPrivateKey == null && StringUtils . isNotBlank ( this . getPrivateKeyPath ()) ) {
299
299
try (InputStream keyInputStream = this .loadConfigInputStream (this .getPrivateKeyString (), this .getPrivateKeyPath (),
300
300
this .privateKeyContent , "privateKeyPath" )) {
301
301
merchantPrivateKey = PemUtils .loadPrivateKey (keyInputStream );
302
302
}
303
303
}
304
- if (certificate == null && StringUtils .isBlank (this .getCertSerialNo ())) {
304
+ if (certificate == null && StringUtils .isBlank (this .getCertSerialNo ()) && StringUtils . isNotBlank ( this . getPrivateCertPath ()) ) {
305
305
try (InputStream certInputStream = this .loadConfigInputStream (this .getPrivateCertString (), this .getPrivateCertPath (),
306
306
this .privateCertContent , "privateCertPath" )) {
307
307
certificate = PemUtils .loadCertificate (certInputStream );
You can’t perform that action at this time.
0 commit comments