ssl handshake error

Discussion in 'Java' started by G. Garrett Campbell, Feb 28, 2008.

  1. I am attempting to connect to an ssl server and I get the following error:

    Both IE and Firefox connect to this site correctly.

    Using very similar code (HttpClient) I am able to connect to other https
    sites.

    Any idea whats wrong?

    [I also tried java1.6 with similar results]

    Thanks

    C:\trackm\air>"c:\program files\java\jdk1.5.0_07\bin\java" AirBerlin
    track123 Campbell debug
    want
    https://www.airberlin.com/site/topbonus/login_miles.php?LANG=eng
    javax.net.ssl.SSLHandshakeException:
    sun.security.validator.ValidatorException: PKIX path building failed:
    sun.security.provider.certpath.SunCertPathBuilderException: unable to find
    valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)
    at
    com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1518)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)
    at
    com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:848)
    at
    com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:106)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495)
    at
    com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:433)
    at
    com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:818)
    at
    com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1030)
    at
    com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:622)
    at
    com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    at
    org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:828)
    at
    org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2124)
    at
    org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1088)
    at
    org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    at
    org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at
    org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at
    org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    at HttpAccount.formGet(HttpAccount.java:495)
    at HttpAccount.formGet(HttpAccount.java:480)
    at HttpAccount.doit(HttpAccount.java:83)
    at HttpAccount.doit(HttpAccount.java:64)
    at AirBerlin.doit(AirBerlin.java:120)
    at HttpAccount.process(HttpAccount.java:44)
    at AirBerlin.main(AirBerlin.java:18)
    Caused by: sun.security.validator.ValidatorException: PKIX path building
    failed: sun.security.provider.certpath.SunCertPathBuilderException: unable
    to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)
    at
    sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:145)
    at sun.security.validator.Validator.validate(Validator.java:203)
    at
    com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:172)
    at
    com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(SSLContextImpl.java:320)
    at
    com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:841)
    ... 23 more
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
    unable to find valid certification path to requested target
    at
    sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:236)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:194)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)
    ... 28 more
     
    G. Garrett Campbell, Feb 28, 2008
    #1
    1. Advertising

  2. G. Garrett Campbell

    EJP Guest

    G. Garrett Campbell wrote:
    > javax.net.ssl.SSLHandshakeException:
    > sun.security.validator.ValidatorException: PKIX path building failed:
    > sun.security.provider.certpath.SunCertPathBuilderException: unable to find
    > valid certification path to requested target


    This means your truststore doesn't trust the server certificate it
    received. Either get them to use a CA-signed certificate, or (worse) get
    them to export it and import it into your truststore.
     
    EJP, Feb 29, 2008
    #2
    1. Advertising

  3. Why do Firefox and IE accept it, when java does not?
    Is java out of date?
    Thanks

    "EJP" <> wrote in message
    news:d6Oxj.20595$...
    > G. Garrett Campbell wrote:
    >> javax.net.ssl.SSLHandshakeException:
    >> sun.security.validator.ValidatorException: PKIX path building failed:
    >> sun.security.provider.certpath.SunCertPathBuilderException: unable to
    >> find valid certification path to requested target

    >
    > This means your truststore doesn't trust the server certificate it
    > received. Either get them to use a CA-signed certificate, or (worse) get
    > them to export it and import it into your truststore.
     
    G. Garrett Campbell, Feb 29, 2008
    #3
  4. G. Garrett Campbell

    EJP Guest

    G. Garrett Campbell wrote:
    > Why do Firefox and IE accept it, when java does not?


    Because they use different truststores?
     
    EJP, Mar 3, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jakekeke
    Replies:
    0
    Views:
    517
    Jakekeke
    Oct 19, 2004
  2. Replies:
    3
    Views:
    444
  3. Replies:
    0
    Views:
    709
  4. Tony Arcieri

    Non-blocking SSL handshake

    Tony Arcieri, Feb 7, 2008, in forum: Ruby
    Replies:
    3
    Views:
    243
    Tony Arcieri
    Feb 8, 2008
  5. Ovidiu Deac

    debugging ssl handshake failure

    Ovidiu Deac, Mar 19, 2012, in forum: Python
    Replies:
    0
    Views:
    340
    Ovidiu Deac
    Mar 19, 2012
Loading...

Share This Page