java.security.cert.CertificateException: No name matching <hostname> found

Solution Unverified - Updated -

Issue

When making an HTTPS invocation from Java (e.g. in JBoss EAP using HttpsURLConnection, JAX-WS client, RESTEasy or JAX-RS client, etc), I receive the following error.

Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching <hostname> found
        at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) [jsse.jar:1.6]
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1611) [jsse.jar:1.6]
        at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187) [jsse.jar:1.6]
        at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181) [jsse.jar:1.6]
        at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1035) [jsse.jar:1.6]

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x
  • Java

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.