Java SSL: how to disable hostname verification

前端 未结 5 1175
情深已故
情深已故 2020-11-29 01:54

Is there a way for the standard java SSL sockets to disable hostname verfication for ssl connections with a property? The only way I found until now, is to write a hostname

5条回答
  •  感动是毒
    2020-11-29 02:20

    There is no hostname verification in standard Java SSL sockets or indeed SSL, so that's why you can't set it at that level. Hostname verification is part of HTTPS (RFC 2818): that's why it manifests itself as javax.net.ssl.HostnameVerifier, which is applied to an HttpsURLConnection.

提交回复
热议问题