3 Replies Latest reply on Oct 5, 2004 12:46 PM by Nikola Ivačič

    Yet another AnyhostVerifier problem

    Nikola Ivačič Newbie

      1.) I've generated selfsigned certificate

      2.) I've used the:

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

      3.) SSL handshake failes due to:
      Exception in thread "main" javax.naming.NamingException: Failed to retrieve Naming interface [Root exception is java.io.IOException]
       at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContextFactory.java:69)
       at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
       at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
       at javax.naming.InitialContext.init(InitialContext.java:219)
       at javax.naming.InitialContext.<init>(InitialContext.java:195)
       at sub.main(sub.java:74)
      Caused by: 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)
       ... 5 more
      Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
       at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
       at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
       at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
       at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
       at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
       at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA6275)
       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)
       ... 6 more
      Caused by: sun.security.validator.ValidatorException: No trusted certificate found
       at sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator.java:304)
       at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:107)
       at sun.security.validator.Validator.validate(Validator.java:202)
       at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(DashoA6275)
       at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(DashoA6275)
       ... 20 more
      

      4.) the AnyhostVerifier is set correctly but the "invoke" method that returns Boolean.TRUE is never called and
      I guess that HostNameVerification failes.

      5.) the connection was tested in browser, so I assume the server side works ok.

      I got a little lost reading about the "new" JSSE javax.net.ssl packages (I'm using j2sdk 1.4.3)

      Is there a System property that can solve the problem

      thanks