Java client certificates over HTTPS/SSL

后端 未结 8 987
攒了一身酷
攒了一身酷 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:27

    Have you set the KeyStore and/or TrustStore System properties?

    java -Djavax.net.ssl.keyStore=pathToKeystore -Djavax.net.ssl.keyStorePassword=123456
    

    or from with the code

    System.setProperty("javax.net.ssl.keyStore", pathToKeyStore);
    

    Same with javax.net.ssl.trustStore

提交回复
热议问题