mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-02 20:02:37 +08:00
🎨 优化部分代码
This commit is contained in:
parent
d3552245a5
commit
d2571d094b
@ -182,7 +182,6 @@ public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
|
|||||||
.register("https", this.sslConnectionSocketFactory)
|
.register("https", this.sslConnectionSocketFactory)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@SuppressWarnings("resource")
|
|
||||||
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(registry);
|
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(registry);
|
||||||
connectionManager.setMaxTotal(this.maxTotalConn);
|
connectionManager.setMaxTotal(this.maxTotalConn);
|
||||||
connectionManager.setDefaultMaxPerRoute(this.maxConnPerHost);
|
connectionManager.setDefaultMaxPerRoute(this.maxConnPerHost);
|
||||||
@ -238,12 +237,7 @@ public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
|
|||||||
try {
|
try {
|
||||||
SSLContext sslcontext = SSLContexts.custom()
|
SSLContext sslcontext = SSLContexts.custom()
|
||||||
//忽略掉对服务器端证书的校验
|
//忽略掉对服务器端证书的校验
|
||||||
.loadTrustMaterial(new TrustStrategy() {
|
.loadTrustMaterial((TrustStrategy) (chain, authType) -> true).build();
|
||||||
@Override
|
|
||||||
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}).build();
|
|
||||||
|
|
||||||
return new SSLConnectionSocketFactory(
|
return new SSLConnectionSocketFactory(
|
||||||
sslcontext,
|
sslcontext,
|
||||||
|
Loading…
Reference in New Issue
Block a user