This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes CertificateException: No name matching <hostname> found. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "CertificateException: No name matching <hostname> found." Watch "CertificateException: No name matching <hostname> found." New topic
Author

CertificateException: No name matching <hostname> found.

Aodhan Hoffman
Ranch Hand

Joined: May 21, 2004
Posts: 35

I'm trying to access a web service that uses BASIC Auth + SSL with a self-signed cert. I've cobbled together code that should work, and imported the cert from the server into a keystore. I have verified that the CN for the crt is identical to the target hostname and matches exactly what CertificateException is telling me it needs. I've hit a brick wall here and would appreciate any assistance an SSL veteran can provide. Thanks!



code:


and the certs in my keystore



-------<br /> Aodhan H - Ad Astra Per Aspera<br /> -------
Bharat Kasodariya
Ranch Hand

Joined: Aug 19, 2011
Posts: 36
Your cn name should match with your host name
Aodhan Hoffman
Ranch Hand

Joined: May 21, 2004
Posts: 35

Thanks. I am aware the hostname lab-nf-01.ns.cs.boeing.com must match the CN lab-nf-01.ns.cs.boeing.com.
They do, which is why the error is so frustrating and unhelpful.
Mitch Britton
Greenhorn

Joined: Jul 02, 2012
Posts: 1
You could try using a hostname verifier:


 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: CertificateException: No name matching <hostname> found.
 
Similar Threads
Attempt to retrieve Sharepoint WSDL fails with “Server redirected too many times”
Error in JAXWS client web service usig dynamic url
javax.xml.ws.Service problem
javax.xml.ws.Service problem
WSDL access error