java.security.cert.CertificateException

javax.net.ssl.SSLPeerUnverifiedException

final RestTemplate restTemplate = new RestTemplate();
restTemplate.setRequestFactory(new SimpleClientHttpRequestFactory() {
@Override
protected void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException {
if (connection instanceof HttpsURLConnection) {
((HttpsURLConnection) connection).setHostnameVerifier(PROMISCUOUS_VERIFIER);
}
super.prepareConnection(connection, httpMethod);
}
});//访问https禁用证书检查

 

相关文章:

  • 2021-09-13
  • 2021-12-23
  • 2021-10-10
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2021-05-12
猜你喜欢
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2021-11-08
  • 2022-12-23
相关资源
相似解决方案