@@ -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