File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11package com .github .binarywang .wxpay .config ;
22
3+ import org .apache .commons .lang3 .StringUtils ;
34import org .apache .http .ssl .SSLContexts ;
45
56import javax .net .ssl .SSLContext ;
@@ -143,13 +144,17 @@ public void setUseSandboxEnv(boolean useSandboxEnv) {
143144 }
144145
145146 public SSLContext initSSLContext () {
146- if (null == mchId ) {
147- throw new IllegalArgumentException ("请确保商户号mch_id已设置" );
147+ if (StringUtils .isBlank (mchId )) {
148+ throw new IllegalArgumentException ("请确保商户号mchId已设置" );
149+ }
150+
151+ if (StringUtils .isBlank (this .keyPath )) {
152+ throw new IllegalArgumentException ("请确保证书文件地址keyPath已配置" );
148153 }
149154
150155 File file = new File (this .keyPath );
151156 if (!file .exists ()) {
152- throw new RuntimeException ("证书文件: 【" + file .getPath () + "】不存在!" );
157+ throw new RuntimeException ("证书文件【" + file .getPath () + "】不存在!" );
153158 }
154159
155160 try {
You can’t perform that action at this time.
0 commit comments