1
votes

I am trying to run a Jersey client class in Eclipse where the server requires a certificate. I grabbed the certificate, but can't figure out which keystore to import it into. In my Eclipse config, I have the java.home set to C:\Java\jdk1.6.0_18\jre

In my C:\Java\jdk1.6.0_18\jre\lib\security folder I have a cacerts and a jssecacerts file. I've imported the cert into both, restarted Eclipse and when I run the client class, as a Java Application, I get this error:

com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present

I then installed the cert in C:\Java\jdk1.6.0_18\jre\lib\jssecacerts, restarted Eclipse and still get the same error.

Which keystore does Eclipse use????

1

1 Answers

1
votes

My issue turned out to be that the (self-signed) cert had identity mis-match errors. The cert is for a pre-production server. To get around this, I used a combination of tips from http://jcalcote.wordpress.com/2009/06/18/java-https-client-issues/ (DumbX509TrustManager) and http://blogs.oracle.com/enterprisetechtips/entry/consuming_restful_web_services_with to create a workaround for our lab environment.