上传者: fanweimiana
|
上传时间: 2022-08-01 16:21:27
|
文件大小: 2KB
|
文件类型: RAR
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();