Skip to content

Commit db85c19

Browse files
committed
replace this.wxMpConfigStorage with this.getWxMpConfigStorage() #155
1 parent 7ee9ac0 commit db85c19

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceImpl.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -420,26 +420,19 @@ public CloseableHttpClient getHttpclient() {
420420
}
421421

422422
private void initHttpClient() {
423-
ApacheHttpClientBuilder apacheHttpClientBuilder = this.wxMpConfigStorage
424-
.getApacheHttpClientBuilder();
423+
WxMpConfigStorage configStorage = this.getWxMpConfigStorage();
424+
ApacheHttpClientBuilder apacheHttpClientBuilder = configStorage.getApacheHttpClientBuilder();
425425
if (null == apacheHttpClientBuilder) {
426426
apacheHttpClientBuilder = DefaultApacheHttpClientBuilder.get();
427427
}
428428

429-
apacheHttpClientBuilder.httpProxyHost(this.getWxMpConfigStorage().getHttpProxyHost())
430-
.httpProxyPort(this.getWxMpConfigStorage().getHttpProxyPort())
431-
.httpProxyUsername(this.getWxMpConfigStorage().getHttpProxyUsername())
432-
.httpProxyPassword(this.getWxMpConfigStorage().getHttpProxyPassword());
429+
apacheHttpClientBuilder.httpProxyHost(configStorage.getHttpProxyHost())
430+
.httpProxyPort(configStorage.getHttpProxyPort())
431+
.httpProxyUsername(configStorage.getHttpProxyUsername())
432+
.httpProxyPassword(configStorage.getHttpProxyPassword());
433433

434-
// if (this.getWxMpConfigStorage().getSSLContext() != null) {
435-
// SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
436-
// this.getWxMpConfigStorage().getSSLContext(), new String[] { "TLSv1" }, null,
437-
// new DefaultHostnameVerifier());
438-
// apacheHttpClientBuilder.sslConnectionSocketFactory(sslsf);
439-
// }
440-
441-
if (this.getWxMpConfigStorage().getHttpProxyHost() != null && this.getWxMpConfigStorage().getHttpProxyPort() > 0) {
442-
this.httpProxy = new HttpHost(this.getWxMpConfigStorage().getHttpProxyHost(), this.getWxMpConfigStorage().getHttpProxyPort());
434+
if (configStorage.getHttpProxyHost() != null && configStorage.getHttpProxyPort() > 0) {
435+
this.httpProxy = new HttpHost(configStorage.getHttpProxyHost(), configStorage.getHttpProxyPort());
443436
}
444437

445438
this.httpClient = apacheHttpClientBuilder.build();

0 commit comments

Comments
 (0)