hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Gl├╝ck <...@odi.ch>
Subject Re: javax.net.ssl.SSLHandshakeException as a result of new GetMethod("/") ?
Date Thu, 24 Aug 2006 12:32:38 GMT
Guy,

Please provide a wirelog of the two requests.

Ortwin

Guy wrote:
> Hi all,
> 
> i have written an application that checks https connections. I use the
> HTTPClient 3.0.1 as described in the SSL guide
> 
> Protocol myhttps = new Protocol("https", new MySSLSocketFactory(), 443);
> 
> HttpClient httpclient = new HttpClient();
> httpclient.getHostConfiguration().setHost(myHost, myPort, myhttps);
> GetMethod httpget = new GetMethod(myObject);
> try {
>  httpclient.executeMethod(httpget);
> 
>  byte[] repsonse = getResponseBody();
> 
>  System.out.println(httpget.getStatusLine());
> } finally {
>  httpget.releaseConnection();
> }
> 
> i have two versions of the MySSLSocketFactory: one that does not use a
> truststore (accepting any certificate) and one that does.
> 
> i have the following parameters to set:
> 
> myHost, myPort, truststore (used to determine which version of the
> MySSLSocketFactory to use), truststorepassword and myObject.
> 
> In the case i set myObject to "/" i get no exception, in case i set
> myObject to "/index.html" i get the following exception:
> 
> 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
> 
> The code works fine for other hosts and the result does not change
> when using the other version of MySSLSocketFactory: the value of
> myObject determines the exception (if the host experiences this
> problem)
> 
> 
> I am stunned because the certificates are valid and are in the
> truststore (if they are used)
> 
> Any suggestion or help would be appreciated
> 

-- 
[web]  http://www.odi.ch/
[blog] http://www.odi.ch/weblog/
[pgp]  key 0x81CF3416
        finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message