4 Replies Latest reply on Jul 7, 2004 5:49 AM by sero

    EJB call with RMI over HTTPS

    sero

      Hi,
      I'm using jboss3.2.4+tomcat50
      I need to call ejb using RMI over HTTPS. I first enabled ssl on tomcat. While RMI over HTTP works perfectly, when I change the client initial connection to https I consistently receive this error:

      java.io.IOException
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:593)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(DashoA6275)
      at org.jboss.naming.HttpNamingContextFactory.getNamingServer(HttpNamingContextFactory.java:117)
      at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContextFactory.java:65)
      ... 10 more
      Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(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(HttpURLConnection.java:617)
      at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.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(DashoA6275)
      at org.jboss.naming.HttpNamingContextFactory.getNamingServer(HttpNamingContextFactory.java:112)
      ... 11 more
      Caused by: java.io.EOFException: SSL peer shut down incorrectly
      at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA6275)
      ... 22 more

      Any idea or guideline?
      Thanks, dikran

        • 1. Re: EJB call with RMI over HTTPS

          I have no problems with this. What do your server side logs say? It looks like ssl is not enabled on the server..

          • 2. home lookup goes HTTPS, but home.create goes HTTP.
            sero

            Yes, it was from the client, set wrong port. Now it goes ok.

            But now, another problem: The first call (lookup) is made using https, but the subsequent calls to the home interfaces are mede using http.
            Initally I set up the configuration for the stateless-http-invoker that tells the home's proxy how to call back.
            Is there something similar for https?

            thanks

            • 3. Re: EJB call with RMI over HTTPS

              In deploy/http-invoker.sar/META-INF/jboss-service.xml the HttpInvoker mbean should look like


              <!-- Use a URL of the form http://:8080/invoker/EJBInvokerServlet
              where is InetAddress.getHostname value on which the server
              is running.
              -->
              https://
              :8443/invoker/restricted/EJBInvokerServlet
              true


              The proxy factory ..


              <!-- The Naming service we are proxying -->
              jboss:service=Naming
              <!-- Compose the invoker URL from the cluster node address -->
              https://
              :8443/invoker/restricted/JMXInvokerServlet
              true
              org.jnp.interfaces.Naming



              jc.client.ClientInterceptor
              org.jboss.proxy.ClientMethodInterceptor
              org.jboss.proxy.SecurityInterceptor
              org.jboss.naming.interceptors.ExceptionInterceptor
              org.jboss.invocation.InvokerInterceptor


              • 4. Re: EJB call with RMI over HTTPS
                sero

                Thanks, rimmeraj, now all works, your help was very valuable.