Java client certificates over HTTPS/SSL

后端 未结 8 1001
攒了一身酷
攒了一身酷 2020-11-22 13:46

I am using Java 6 and am trying to create an HttpsURLConnection against a remote server, using a client certificate.
The server is using an selfsigned root

8条回答
  •  借酒劲吻你
    2020-11-22 14:26

    If you are dealing with a web service call using the Axis framework, there is a much simpler answer. If all want is for your client to be able to call the SSL web service and ignore SSL certificate errors, just put this statement before you invoke any web services:

    System.setProperty("axis.socketSecureFactory", "org.apache.axis.components.net.SunFakeTrustSocketFactory");

    The usual disclaimers about this being a Very Bad Thing to do in a production environment apply.

    I found this at the Axis wiki.

提交回复
热议问题