5 Replies Latest reply on Jan 19, 2005 2:33 AM by hama

    JBoss3.2.6-JNDI Over https not working

    ss_jain

      I am trying to use jndi over https but I am getting handshake exception.
      JNDI over http is working. I am running this program from stand alone java client and using self signed certificate on the server.

      Properties env = new Properties();
      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
      env.setProperty(Context.PROVIDER_URL,"https://a.b.com:8443/invoker/JNDIFactory");
      Context iniCtx = new InitialContext(env);

      I get the following exception-
      Exception in thread "main" javax.naming.NamingException: Failed to retrieve Nami
      ng interface. Root exception is javax.net.ssl.SSLHandshakeException: Couldn't f
      ind trusted certificate
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)

      On the server side I have made clentAuth=False in tomcat configuration.

        • 1. Re: JBoss3.2.6-JNDI Over https not working
          ss_jain

          Need your input on this, anyone who has come accross this issue.

          • 2. Re: JBoss3.2.6-JNDI Over https not working

            Moderated: Not a JMS Question


            Exception in thread "main" javax.naming.NamingException: Failed to retrieve Nami
            ng interface. Root exception is javax.net.ssl.SSLHandshakeException: Couldn't f
            ind trusted certificate
            at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)


            Go researh the idea of a trust store. You will find it in the JDK documentation
            or the admin docs.

            • 3. Re: JBoss3.2.6-JNDI Over https not working
              ss_jain

              I could fix the ssl handshake problem but its still throwing exception. I'll post the exception. Its something to do with HTTP container (tomcat) and jboss communication. Can you point me to the exact configuration to enable jndi over https.

              • 4. Re: JBoss3.2.6-JNDI Over https not working
                ss_jain

                Here is the exception I am getting, please let me know how to fix this as soon as you can-

                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

                • 5. Re: JBoss3.2.6-JNDI Over https not working
                  hama

                  what is the server cert you use on the server a.b.com:8443? is it issued by a known CA, if it is self-signed, you have to import it into your jdk keystore.