"java.io.IOException: HTTPS hostname wrong" when connecting to HTTPS server

Solution Verified - Updated -

Issue

  • The following exception appears when a JBoss WS client is connecting via HTTPS to http://a.example.com.
    Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker. HTTPS hostname wrong:  should be <c.example.com>.
         at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:380)
         at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:149)
         at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:141)
         at org.jboss.remoting.Client.invoke(Client.java:1935)
         at org.jboss.remoting.Client.invoke(Client.java:788)
         at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:190)
         ... 7 more
    Caused by: java.io.IOException: HTTPS hostname wrong:  should be <b.example.com>
         at sun.net.www.protocol.https.HttpsClient.checkURLSpoofing(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
         at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl.getOutputStream(Unknown Source)
         at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:300)
         ... 12 more

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.x

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