File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -262,12 +262,12 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
262262
263263 InputStream keyInputStream = this .loadConfigInputStream (this .getPrivateKeyString (), this .getPrivateKeyPath (),
264264 this .privateKeyContent , "privateKeyPath" );
265- InputStream certInputStream = this .loadConfigInputStream (this .getPrivateCertString (), this .getPrivateCertPath (),
266- this .privateCertContent , "privateCertPath" );
267265 try {
268266 PrivateKey merchantPrivateKey = PemUtils .loadPrivateKey (keyInputStream );
269- X509Certificate certificate = PemUtils .loadCertificate (certInputStream );
270267 if (StringUtils .isBlank (this .getCertSerialNo ())) {
268+ InputStream certInputStream = this .loadConfigInputStream (this .getPrivateCertString (), this .getPrivateCertPath (),
269+ this .privateCertContent , "privateCertPath" );
270+ X509Certificate certificate = PemUtils .loadCertificate (certInputStream );
271271 this .certSerialNo = certificate .getSerialNumber ().toString (16 ).toUpperCase ();
272272 }
273273 //构造Http Proxy正向代理
@@ -290,6 +290,8 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
290290 this .privateKey = merchantPrivateKey ;
291291
292292 return httpClient ;
293+ } catch (WxPayException e ) {
294+ throw e ;
293295 } catch (Exception e ) {
294296 throw new WxPayException ("v3请求构造异常!" , e );
295297 }
You can’t perform that action at this time.
0 commit comments