Disabling SSL Certificate Validation in Spring RestTemplate

后端 未结 12 1480
花落未央
花落未央 2020-11-28 20:05

I am having two Spring based web apps A and B, on two different machines.

I want to make a https call from web app A to web app B, however I am using a self-signed c

12条回答
  •  青春惊慌失措
    2020-11-28 20:35

    Security: disable https/TLS certificate hostname check,the following code worked in spring boot rest template

    *HttpsURLConnection.setDefaultHostnameVerifier(
            //SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER
            // * @deprecated (4.4) Use {@link org.apache.http.conn.ssl.NoopHostnameVerifier}
            new NoopHostnameVerifier()
    );*
    

提交回复
热议问题