How to disable SSL certificate checking with Spring RestTemplate?

后端 未结 9 1186
余生分开走
余生分开走 2020-11-29 18:11

I am trying to write an integration test where our test launches an embedded HTTPS server using Simple. I created a self-signed certificate using keytool and am able to acce

9条回答
  •  独厮守ぢ
    2020-11-29 19:02

    Disabling certificate checking is the wrong solution, and radically insecure.

    The correct solution is to import the self-signed certificate into your truststore. An even more correct solution is to get the certificate signed by a CA.

    If this is 'only for testing' it is still necessary to test the production configuration. Testing something else isn't a test at all, it's just a waste of time.

提交回复
热议问题