SSL跳过证书 java
ctx.init(null, new TrustManager[] { tm }, new java.security.SecureRandom());
// SSLConnectionSocketFactory ssf = new SSLConnectionSocketFactory(
// ctx, NoopHostnameVerifier.INSTANCE);
SSLConnectionSocketFactory ssf = new SSLConnectionSocketFactory(
ctx, new TrustAnyHostnameVerifier());
CloseableHttpClient httpclient = HttpClients.custom()
.setSSLSocketFactory(ssf).build();
2022-08-01 16:21:27
2KB
java
1