5 Replies Latest reply on Jun 22, 2006 5:22 AM by vasanth_java

    java.io.IOException: HTTPS hostname wrong:  should be <172.2

    vasanth_java Newbie

      i am using HTTPS in my application.

      steps to reproduce

      1)i am using the following file content in my application. that means i am using the same code/logic of following files in my application.
      (like the code for mbean creation, configurational XML content setting and etc)

      org\jboss\test\remoting\transport\http\ssl\basic\HTTPSInvokerTestServer

      org\jboss\test\remoting\transport\http\ssl\basic\HTTPSInvokerTestClient

      2) i am created the .keystore and .truststore files on my own and placed them in my application properly.

      3)i used proper password for javax.net.ssl.keyStorePassword.

      4) i specified the correct settings in SSLInvokerConstants class.

      5)i started the server.

      6) i am accessing through running the client.
      (Server and client are running in the same system.)
      my ip address is 172.24.58.92

      I am getting the following Exception.


      Calling remoting server with locator uri of: https://172.24.58.92:8888
      java.lang.Exception: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
      at org.jboss.remoting.samples.callback.HTTPSInvokerTestClient.testInvoca
      tionWithHeaders(HTTPSInvokerTestClient.java:108)
      at org.jboss.remoting.samples.callback.HTTPSInvokerTestClient.main(HTTPSInvokerTestClient.java:135)
      Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
      at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnect
      ion(HTTPClientInvoker.java:201)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:81)
      at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
      at org.jboss.remoting.Client.invoke(Client.java:525)
      at org.jboss.remoting.Client.invoke(Client.java:488)
      at org.jboss.remoting.Client.invoke(Client.java:473)
      at org.jboss.remoting.samples.callback.HTTPSInvokerTestClient.testInvoca
      tionWithHeaders(HTTPSInvokerTestClient.java:102)
      ... 1 more
      Caused by: java.io.IOException: HTTPS hostname wrong: should be <172.24.58.92>
      at sun.net.www.protocol.https.HttpsClient.b(DashoA6275)
      at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
      at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
      (DashoA6275)
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:560)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Das
      hoA6275)
      at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnect
      ion(HTTPClientInvoker.java:163)
      ... 7 more

      Please provide the help. Thanks in advance.


        • 1. Re: java.io.IOException: HTTPS hostname wrong:  should be <1
          vasanth_java Newbie

          Actually our understanding is whenever we are connecting from jboss remoting client to jboss remoting server through HTTPS, actually we need to pass the meta data, otherwise it will throw the exception which is shown in previous post.(java.io.IOException: HTTPS hostname wrong: should be )

          sample meta data and invoke method calling code:

          Map metadata = new HashMap();
          metadata.put(Client.RAW, Boolean.TRUE);
          metadata.put("TYPE", "POST");
          Properties headerProps = new Properties();
          headerProps.put("SOAPAction", "http://www.example.com/fibonacci");
          headerProps.put("Content-type", "application/soap+xml");
          metadata.put("HEADER", headerProps);
          metadata.put(HTTPSClientInvoker.IGNORE_HTTPS_HOST, "true");
          Object response = null;
          response = remotingClient.invoke(HTTPInvokerTestServer.NULL_RETURN_PARAM, metadata);


          it is ok that we can send the meta data whenever requires.

          but while adding the listener, the Previous post Exception(java.io.IOException: HTTPS hostname wrong: should be ) occurs. at that time how to send?

          remotingClient.addListener(callbackHandler);

          Note: callbackHandler is the instance of InvokerCallbackHandler.

          in what scenarios this exception will raise? How to avoid that exception?

          we are halted because of this issue.

          please help us.



          • 2. Re: java.io.IOException: HTTPS hostname wrong:  should be <1
            vasanth_java Newbie

            We found that whenever jboss remoting client connect to jboss remoting server through HTTPS, the hostname is verified.

            so we setted the system property like

            System.setProperty("org.jboss.security.ignoreHttpsHost", "true" );

            Now we are getting the connection time out exception

            org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
            at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:201)
            at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:80)
            at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
            at org.jboss.remoting.Client.invoke(Client.java:525)
            at org.jboss.remoting.Client.addListener(Client.java:720)
            at org.jboss.remoting.Client.addListener(Client.java:686)
            at org.jboss.remoting.Client.addListener(Client.java:668)
            at org.jboss.test.remoting.transport.http.ssl.basic.CallbackNewSSLClient.testPullCallback(CallbackNewSSLClient.java:119)
            at org.jboss.test.remoting.transport.http.ssl.basic.CallbackNewSSLClient.main(CallbackNewSSLClient.java:158)
            Caused by: java.net.ConnectException: Connection timed out: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
            at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
            at java.net.Socket.connect(Socket.java:452)
            at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)
            at com.sun.net.ssl.internal.ssl.SSLSocketImpl.(DashoA6275)
            at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(DashoA6275)
            at sun.net.www.protocol.https.HttpsClient.doConnect(DashoA6275)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
            at sun.net.www.protocol.https.HttpsClient.(DashoA6275)
            at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)
            at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)
            at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)
            at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.plainConnect(DashoA6275)
            at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA6275)
            at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:560)
            at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(DashoA6275)
            at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:163)
            ... 8 more
            EXCEPTION ====>org.jboss.remoting.CannotConnectException: Can not connect http client invoker.

            we are unable to forward. please help immediately.


            • 3. Re: java.io.IOException: HTTPS hostname wrong:  should be <1
              vasanth_java Newbie

              because of our wrong ip and port configurations only we got the connection time out exception.

              i think the org.jboss.security.ignoreHttpHost = true is disabled the host name verification. it corrects the java.io.IOException: HTTPS hostname wrong: exception.

              if we get any further issues, then we will let you know.

              • 4. Re: java.io.IOException: HTTPS hostname wrong:  should be <1
                vasanth_java Newbie

                Now we got another problem.

                the above SSL implementation is correctly working with in LAN.

                when using proxy server and static ip stuffs,

                then we are getting this following exception. (java.net.NoRouteToHostException: No route to host: connect)

                Actually our URI is like

                https://203.199.209.149:8888

                203.199.209.149 is the static ip address.

                we are setting the proxy settings through the system properties.

                System.setProperty("http.proxySet", "true" );
                System.setProperty("http.proxyHost", "172.24.1.1" );
                System.setProperty("http.proxyPort", "80" );
                System.setProperty("org.jboss.security.ignoreHttpsHost", "true" );

                172.24.1.1 is the proxy ip address.

                we are able to ping the proxy ip address.

                is there any additional configurational settings?

                what's the exact problem?


                org.jboss.remoting.CannotConnectException: Can not connect http client invoker.

                at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:201)

                at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:80)

                at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)

                at org.jboss.remoting.Client.invoke(Client.java:525)

                at org.jboss.remoting.Client.addListener(Client.java:720)

                at org.jboss.remoting.Client.addListener(Client.java:686)

                at org.jboss.remoting.Client.addListener(Client.java:668)

                at org.jboss.test.remoting.transport.http.ssl.basic.CallbackNewSSLClient.testPullCallback(CallbackNewSSLClient.java:99)

                at org.jboss.test.remoting.transport.http.ssl.basic.CallbackNewSSLClient.main(CallbackNewSSLClient.java:141)

                Caused by: java.net.NoRouteToHostException: No route to host: connect

                at java.net.PlainSocketImpl.socketConnect(Native Method)

                at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)

                at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)

                at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)

                at java.net.Socket.connect(Socket.java:452)

                at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)

                at com.sun.net.ssl.internal.ssl.SSLSocketImpl.(DashoA6275)

                at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(DashoA6275)

                at sun.net.www.protocol.https.HttpsClient.doConnect(DashoA6275)

                at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)

                at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)

                at sun.net.www.protocol.https.HttpsClient.(DashoA6275)

                at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)

                at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)

                at sun.net.www.protocol.https.HttpsClient.a(DashoA6275)

                at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.plainConnect(DashoA6275)

                at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA6275)

                at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:560)

                at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(DashoA6275)

                at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:163)

                ... 8 more

                is there any additional configurational settings?

                what's the exact problem?

                please reply for this.

                • 5. Re: java.io.IOException: HTTPS hostname wrong:  should be <1
                  vasanth_java Newbie

                  we got the problem and solution.

                  we mistaken in the protocol name of system properties. actually we specified as http instead of https. that's the problem. while u r using https, u have to specify the system properties like "https.proxySet".
                  sample code:
                  System.setProperty("https.proxySet", "true" );
                  System.setProperty("https.proxyHost", "172.24.1.1" );
                  System.setProperty("https.proxyPort", "80" );

                  if u r facing above problems, then make use of it. thanks.