mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-01-24 05:42:06 +08:00
🎨 #3830 【公共问题】修复使用HttpComponents时不配置proxy password启动报错问题
This commit is contained in:
@@ -5,7 +5,6 @@ import me.chanjar.weixin.channel.bean.token.StableTokenParam;
|
||||
import me.chanjar.weixin.channel.config.WxChannelConfig;
|
||||
import me.chanjar.weixin.channel.util.JsonUtils;
|
||||
import me.chanjar.weixin.common.util.http.HttpClientType;
|
||||
import me.chanjar.weixin.common.util.http.apache.ApacheBasicResponseHandler;
|
||||
import me.chanjar.weixin.common.util.http.hc.BasicResponseHandler;
|
||||
import me.chanjar.weixin.common.util.http.hc.DefaultHttpComponentsClientBuilder;
|
||||
import me.chanjar.weixin.common.util.http.hc.HttpComponentsClientBuilder;
|
||||
@@ -41,7 +40,7 @@ public class WxChannelServiceHttpComponentsImpl extends BaseWxChannelServiceImpl
|
||||
apacheHttpClientBuilder.httpProxyHost(config.getHttpProxyHost())
|
||||
.httpProxyPort(config.getHttpProxyPort())
|
||||
.httpProxyUsername(config.getHttpProxyUsername())
|
||||
.httpProxyPassword(config.getHttpProxyPassword().toCharArray());
|
||||
.httpProxyPassword(config.getHttpProxyPassword() == null ? null : config.getHttpProxyPassword().toCharArray());
|
||||
|
||||
if (config.getHttpProxyHost() != null && config.getHttpProxyPort() > 0) {
|
||||
this.httpProxy = new HttpHost(config.getHttpProxyHost(), config.getHttpProxyPort());
|
||||
|
||||
Reference in New Issue
Block a user