I have found the problem, one small but important omission, I didn't register
my new protocol:
Protocol.registerProtocol("https", 
                new Protocol("https", new EasySSLProtocolSocketFactory(),
443));

it works now


mike wylie-2 wrote:
> 
> 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();
>         }
>     }
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Another-unsigned-SSL-problem-tp22183572p22204385.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to