Skip to content

Commit d2571d0

Browse files
committed
🎨 优化部分代码
1 parent d355224 commit d2571d0

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ private synchronized void prepare() {
182182
.register("https", this.sslConnectionSocketFactory)
183183
.build();
184184

185-
@SuppressWarnings("resource")
186185
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(registry);
187186
connectionManager.setMaxTotal(this.maxTotalConn);
188187
connectionManager.setDefaultMaxPerRoute(this.maxConnPerHost);
@@ -238,12 +237,7 @@ private SSLConnectionSocketFactory buildSSLConnectionSocketFactory() {
238237
try {
239238
SSLContext sslcontext = SSLContexts.custom()
240239
//忽略掉对服务器端证书的校验
241-
.loadTrustMaterial(new TrustStrategy() {
242-
@Override
243-
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
244-
return true;
245-
}
246-
}).build();
240+
.loadTrustMaterial((TrustStrategy) (chain, authType) -> true).build();
247241

248242
return new SSLConnectionSocketFactory(
249243
sslcontext,

0 commit comments

Comments
 (0)