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 {
295295 this .certSerialNo = certificate .getSerialNumber ().toString (16 ).toUpperCase ();
296296 }
297297 try {
298- if (merchantPrivateKey == null ) {
298+ if (merchantPrivateKey == null && StringUtils . isNotBlank ( this . getPrivateKeyPath ()) ) {
299299 try (InputStream keyInputStream = this .loadConfigInputStream (this .getPrivateKeyString (), this .getPrivateKeyPath (),
300300 this .privateKeyContent , "privateKeyPath" )) {
301301 merchantPrivateKey = PemUtils .loadPrivateKey (keyInputStream );
302302 }
303303 }
304- if (certificate == null && StringUtils .isBlank (this .getCertSerialNo ())) {
304+ if (certificate == null && StringUtils .isBlank (this .getCertSerialNo ()) && StringUtils . isNotBlank ( this . getPrivateCertPath ()) ) {
305305 try (InputStream certInputStream = this .loadConfigInputStream (this .getPrivateCertString (), this .getPrivateCertPath (),
306306 this .privateCertContent , "privateCertPath" )) {
307307 certificate = PemUtils .loadCertificate (certInputStream );
You can’t perform that action at this time.
0 commit comments