Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

Support for .pem RA certificate

Updated: 03 Jan 2012 | 1 comment
sw_dev's picture
+1 1 Vote
Login to vote
This issue has been solved. See solution.

 

The sample code in test drive uses a certificate of type pkcs12, .p12. 

I'm using keystores, supporting multiple certificate, and the preferred format is JKS, .pem. 

I'm using the following code:

 

System.setProperty("javax.net.ssl.keyStoreType", "JKS");

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

System.setProperty("javax.net.ssl.keyStorePassword", "*********");

 

However, I'm getting an SSL Error:

java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)

Is there a different keystore type I should be using? Am I required to have my certificate in pkcs12 format?

I'm pretty sure the keystoretype JKS exists, but please correct me if I'm wrong, because I've been googling all day and my brain might be on backwards by now!

Please note also: I have tried this code with a converted .p12, pkcs12 file and it does work as expected. I'm just hoping this isn't the only format I can use. Thanks!

 

Comments

John Martyn Gunalan's picture
06
Nov
2011
0 Votes 0
Login to vote

Please try this

I found this article on a forum which might be helpful in solving the issue you are facing

http://stackoverflow.com/questions/537040/how-to-connect-to-a-secure-website-using-ssl-in-java-with-a-pkcs12-file