Browse Source

replace this.wxMpConfigStorage with this.getWxMpConfigStorage() #155

master
Binary Wang 8 years ago
parent
commit
db85c1990b
1 changed files with 8 additions and 15 deletions
  1. +8
    -15
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceImpl.java

+ 8
- 15
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceImpl.java View File

@@ -420,26 +420,19 @@ public class WxMpServiceImpl implements WxMpService {
} }


private void initHttpClient() { private void initHttpClient() {
ApacheHttpClientBuilder apacheHttpClientBuilder = this.wxMpConfigStorage
.getApacheHttpClientBuilder();
WxMpConfigStorage configStorage = this.getWxMpConfigStorage();
ApacheHttpClientBuilder apacheHttpClientBuilder = configStorage.getApacheHttpClientBuilder();
if (null == apacheHttpClientBuilder) { if (null == apacheHttpClientBuilder) {
apacheHttpClientBuilder = DefaultApacheHttpClientBuilder.get(); apacheHttpClientBuilder = DefaultApacheHttpClientBuilder.get();
} }


apacheHttpClientBuilder.httpProxyHost(this.getWxMpConfigStorage().getHttpProxyHost())
.httpProxyPort(this.getWxMpConfigStorage().getHttpProxyPort())
.httpProxyUsername(this.getWxMpConfigStorage().getHttpProxyUsername())
.httpProxyPassword(this.getWxMpConfigStorage().getHttpProxyPassword());
apacheHttpClientBuilder.httpProxyHost(configStorage.getHttpProxyHost())
.httpProxyPort(configStorage.getHttpProxyPort())
.httpProxyUsername(configStorage.getHttpProxyUsername())
.httpProxyPassword(configStorage.getHttpProxyPassword());


// if (this.getWxMpConfigStorage().getSSLContext() != null) {
// SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
// this.getWxMpConfigStorage().getSSLContext(), new String[] { "TLSv1" }, null,
// new DefaultHostnameVerifier());
// apacheHttpClientBuilder.sslConnectionSocketFactory(sslsf);
// }

if (this.getWxMpConfigStorage().getHttpProxyHost() != null && this.getWxMpConfigStorage().getHttpProxyPort() > 0) {
this.httpProxy = new HttpHost(this.getWxMpConfigStorage().getHttpProxyHost(), this.getWxMpConfigStorage().getHttpProxyPort());
if (configStorage.getHttpProxyHost() != null && configStorage.getHttpProxyPort() > 0) {
this.httpProxy = new HttpHost(configStorage.getHttpProxyHost(), configStorage.getHttpProxyPort());
} }


this.httpClient = apacheHttpClientBuilder.build(); this.httpClient = apacheHttpClientBuilder.build();


Loading…
Cancel
Save