I've scoured the mailing list but not found quite the answer I need.
Hopefully it's a simple answer and sorry if it's been asked before!

I am trying to make a connection to an SSL server with a self signed
certificate. I've followed the tutorial and created an implementation of
EasySSLProtocolSocketFactory and EasyX509TrustManager. EasyX509TrustManager
does nothing for both the checkClientTrusted() and checkServerTrusted()
methods.

My code connects fine to a site with a valid certificate, but when accessing
my self certified site I still get the error:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target

Do I need to setup something with keystores for this to work? if so a link
to beginners tutorial on how these work would be appreciated.

My basic app:
public static void main(String[] args) throws Exception {

        Protocol myhttps = new Protocol("https", new
EasySSLProtocolSocketFactory(), 443);

        HttpClient httpclient = new HttpClient();
        httpclient.getHostConfiguration().setHost("myLocalServer", 443,
myhttps);
        GetMethod httpget = new GetMethod("https://myLocalServer/";);
        //GetMethod httpget = new GetMethod("https://www.verisign.com/";);

        try {
          httpclient.executeMethod(httpget);
          System.out.println(httpget.getStatusLine());
        } finally {
          httpget.releaseConnection();
        }
    }

Reply via email to