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
    • 7.x
  • Java

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content