users@jersey.java.net

[Jersey] Certificates / truststore question

From: Simon Roberts <simon_at_dancingcloudphotography.com>
Date: Fri, 3 Apr 2015 14:39:46 -0600

Hi all, I have a simple client that's working against a basic server. The
server can run with https, using a self-signed certificate. When I connect
from a browser, I have to first tell the browser to allow an exception for
this certificate, but then the client (using POSTman in Chrome) works just
fine.

How can I get the same thing to work from the JAX-RS 2 (Jersey) client?
Right now, I get protocol exceptions using https (though it works on http)
which I'm fairly sure is because of this certificate.

Here's the exception:

Exception in thread "main" javax.ws.rs.ProcessingException:
javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No name matching local.banana.com
found

Note that the hostname "local.banana.com" is configured in my local
/etc/hosts file--yes, it's fake--and works fine from the browser level, and
works fine for non-http connections. But the self-signed cert has that name
on it, and for various reasons, I don't want to change that right now if I
can help it.

Thanks for any hints!
Cheers,
Simon

-- 
Simon Roberts
Certified Professional Photographer
http://dancingcloudphotography.com
(303) 249 3613