2 Replies Latest reply on Oct 29, 2004 1:21 AM by ss_jain

    HTTPS-JNDI not working

    ss_jain

      I am getting following exception when I try to use jndi over https, if you know how to fix this then please do write in.
      Thanks
      Exception in thread "main" javax.naming.NamingException: Failed to retrieve Nami
      ng interface [Root exception is java.io.IOException]
      at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamin
      gContextFactory.java:69)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
      62)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
      )
      at javax.naming.InitialContext.init(InitialContext.java:219)
      at javax.naming.InitialContext.(InitialContext.java:195)
      at TopicSendClient.setupPubSub(Unknown Source)
      at TopicSendClient.sendAsync(Unknown Source)
      at TopicSendClient.main(Unknown Source)
      Caused by: java.io.IOException
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
      nection.java:593)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Dash
      oA6275)
      at org.jboss.naming.HttpNamingContextFactory.getNamingServer(HttpNamingC
      ontextFactory.java:118)
      at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamin
      gContextFactory.java:65)
      ... 7 more
      Caused by: java.io.IOException: HTTPS hostname wrong: should be <SJAINXXXGX1>
      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.getInputStream(HttpURLCon
      nection.java:617)
      at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLCon
      nection.java:1451)
      at java.net.URLConnection.getHeaderFieldInt(URLConnection.java:476)
      at java.net.URLConnection.getContentLength(URLConnection.java:371)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(Da
      shoA6275)
      at org.jboss.naming.HttpNamingContextFactory.getNamingServer(HttpNamingC
      ontextFactory.java:113)
      ... 8 more

        • 1. Re: HTTPS-JNDI not working
          trosenbaum

           

          ss_jain wrote:

          ... exception when I try to use jndi over https ...
          ...
          Caused by: java.io.IOException: HTTPS hostname wrong: should be <SJAINXXXGX1>
          ...

          This is typically caused by the hostname in the
          URL used to access the resource not precisely
          matching the hostname in the SSL certificate.
          e.g. if the certificate says the host is
          SJAINXXXGX1.some.org then you need to access
          https://SJAINXXXGX1.some.org:443/whatever
          and not
          https://SJAINXXXGX1/whatever

          Otherwise, you must take steps to install a
          more promiscuous hostname verifier.

          • 2. Re: HTTPS-JNDI not working
            ss_jain

            Thanks for the reply. I am using the same host name as it is in self signed certificate but still it throws IO exception.
            sjainxxxgx1.corpet...../.....

            Do you suspect some cofiguration issues in the invoker url (tomcat to jboss communication) because weebserver is working with https.

            Thanks