File tree Expand file tree Collapse file tree 6 files changed +15
-11
lines changed
weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl
weixin-java-cp/src/main/java/me/chanjar/weixin/cp
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl
weixin-java-qidian/src/main/java/me/chanjar/weixin/qidian/api/impl Expand file tree Collapse file tree 6 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 55import me .chanjar .weixin .channel .config .WxChannelConfig ;
66import me .chanjar .weixin .channel .util .JsonUtils ;
77import me .chanjar .weixin .common .util .http .HttpClientType ;
8- import me .chanjar .weixin .common .util .http .apache .ApacheBasicResponseHandler ;
98import me .chanjar .weixin .common .util .http .hc .BasicResponseHandler ;
109import me .chanjar .weixin .common .util .http .hc .DefaultHttpComponentsClientBuilder ;
1110import me .chanjar .weixin .common .util .http .hc .HttpComponentsClientBuilder ;
@@ -41,7 +40,7 @@ public void initHttp() {
4140 apacheHttpClientBuilder .httpProxyHost (config .getHttpProxyHost ())
4241 .httpProxyPort (config .getHttpProxyPort ())
4342 .httpProxyUsername (config .getHttpProxyUsername ())
44- .httpProxyPassword (config .getHttpProxyPassword ().toCharArray ());
43+ .httpProxyPassword (config .getHttpProxyPassword () == null ? null : config . getHttpProxyPassword () .toCharArray ());
4544
4645 if (config .getHttpProxyHost () != null && config .getHttpProxyPort () > 0 ) {
4746 this .httpProxy = new HttpHost (config .getHttpProxyHost (), config .getHttpProxyPort ());
Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ public void initHttp() {
8282 apacheHttpClientBuilder .httpProxyHost (this .configStorage .getHttpProxyHost ())
8383 .httpProxyPort (this .configStorage .getHttpProxyPort ())
8484 .httpProxyUsername (this .configStorage .getHttpProxyUsername ())
85- .httpProxyPassword (this .configStorage .getHttpProxyPassword ().toCharArray ());
85+ .httpProxyPassword (this .configStorage .getHttpProxyPassword () == null ? null :
86+ this .configStorage .getHttpProxyPassword ().toCharArray ());
8687
8788 if (this .configStorage .getHttpProxyHost () != null && this .configStorage .getHttpProxyPort () > 0 ) {
8889 this .httpProxy = new HttpHost (this .configStorage .getHttpProxyHost (), this .configStorage .getHttpProxyPort ());
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ public void initHttp() {
3535 apacheHttpClientBuilder .httpProxyHost (this .configStorage .getHttpProxyHost ())
3636 .httpProxyPort (this .configStorage .getHttpProxyPort ())
3737 .httpProxyUsername (this .configStorage .getHttpProxyUsername ())
38- .httpProxyPassword (this .configStorage .getHttpProxyPassword ().toCharArray ());
38+ .httpProxyPassword (this .configStorage .getHttpProxyPassword () == null ? null :
39+ this .configStorage .getHttpProxyPassword ().toCharArray ());
3940
4041 if (this .configStorage .getHttpProxyHost () != null && this .configStorage .getHttpProxyPort () > 0 ) {
4142 this .httpProxy = new HttpHost (this .configStorage .getHttpProxyHost (), this .configStorage .getHttpProxyPort ());
Original file line number Diff line number Diff line change 1010import me .chanjar .weixin .common .util .http .hc .DefaultHttpComponentsClientBuilder ;
1111import me .chanjar .weixin .common .util .http .hc .HttpComponentsClientBuilder ;
1212import me .chanjar .weixin .common .util .json .GsonParser ;
13- import me .chanjar .weixin .cp .config .WxCpTpConfigStorage ;
1413import me .chanjar .weixin .cp .constant .WxCpApiPathConsts ;
1514import org .apache .hc .client5 .http .classic .methods .HttpPost ;
1615import org .apache .hc .client5 .http .config .RequestConfig ;
@@ -87,9 +86,10 @@ public void initHttp() {
8786 HttpComponentsClientBuilder apacheHttpClientBuilder = DefaultHttpComponentsClientBuilder .get ();
8887
8988 apacheHttpClientBuilder .httpProxyHost (this .configStorage .getHttpProxyHost ())
90- .httpProxyPort (this .configStorage .getHttpProxyPort ())
91- .httpProxyUsername (this .configStorage .getHttpProxyUsername ())
92- .httpProxyPassword (this .configStorage .getHttpProxyPassword ().toCharArray ());
89+ .httpProxyPort (this .configStorage .getHttpProxyPort ())
90+ .httpProxyUsername (this .configStorage .getHttpProxyUsername ())
91+ .httpProxyPassword (this .configStorage .getHttpProxyPassword () == null ? null :
92+ this .configStorage .getHttpProxyPassword ().toCharArray ());
9393
9494 if (this .configStorage .getHttpProxyHost () != null && this .configStorage .getHttpProxyPort () > 0 ) {
9595 this .httpProxy = new HttpHost (this .configStorage .getHttpProxyHost (), this .configStorage .getHttpProxyPort ());
Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ public void initHttp() {
5151 apacheHttpClientBuilder .httpProxyHost (configStorage .getHttpProxyHost ())
5252 .httpProxyPort (configStorage .getHttpProxyPort ())
5353 .httpProxyUsername (configStorage .getHttpProxyUsername ())
54- .httpProxyPassword (configStorage .getHttpProxyPassword ().toCharArray ());
54+ .httpProxyPassword (configStorage .getHttpProxyPassword () == null ? null :
55+ configStorage .getHttpProxyPassword ().toCharArray ());
5556
5657 if (configStorage .getHttpProxyHost () != null && configStorage .getHttpProxyPort () > 0 ) {
5758 this .httpProxy = new HttpHost (configStorage .getHttpProxyHost (), configStorage .getHttpProxyPort ());
Original file line number Diff line number Diff line change @@ -48,8 +48,10 @@ public void initHttp() {
4848 HttpComponentsClientBuilder apacheHttpClientBuilder = DefaultHttpComponentsClientBuilder .get ();
4949
5050 apacheHttpClientBuilder .httpProxyHost (configStorage .getHttpProxyHost ())
51- .httpProxyPort (configStorage .getHttpProxyPort ()).httpProxyUsername (configStorage .getHttpProxyUsername ())
52- .httpProxyPassword (configStorage .getHttpProxyPassword ().toCharArray ());
51+ .httpProxyPort (configStorage .getHttpProxyPort ())
52+ .httpProxyUsername (configStorage .getHttpProxyUsername ())
53+ .httpProxyPassword (configStorage .getHttpProxyPassword () == null ? null :
54+ configStorage .getHttpProxyPassword ().toCharArray ());
5355
5456 if (configStorage .getHttpProxyHost () != null && configStorage .getHttpProxyPort () > 0 ) {
5557 this .httpProxy = new HttpHost (configStorage .getHttpProxyHost (), configStorage .getHttpProxyPort ());
You can’t perform that action at this time.
0 commit comments