hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: SSL
Date Wed, 20 Apr 2005 20:44:27 GMT
Milan,

It is difficult to say for sure without seeing the source code of the
ManualSSLProtocolSocketFactory class but the exception appears to be
Java 1.5 specific. Have you tried running the same code with Java 1.4.2
(using CA certs shipped with Java 1.4.2, of course)?

Oleg

On Wed, 2005-04-20 at 16:49 +0200, Milan Tomic wrote:
> Hi,
> 
>         I've lost a day trying to make SSL connection using HTTP client
> 2.0.2. I have found this example and it works fine:
> 
> HttpClient httpclient = new HttpClient();
> GetMethod httpget = new GetMethod(" <https://www.verisign.com/>
> https://www.verisign.com/");
> httpclient.executeMethod(httpget);
> 
>         But this code doesn't work:
> 
> HttpClient httpclient = new HttpClient();
> GetMethod httpget = new GetMethod(" <https://www.verisign.com/>
> https://www.verisign.com/");
> 
> {
>       KeyStore ksTrustStore = KeyStore.getInstance("JKS");
>       FileInputStream fis = new
> FileInputStream("C:/jdk1.5.0_01/jre/lib/security/cacerts.jks");
>       ksTrustStore.load(fis, "changeit".toCharArray());
>       fis.close();
> 
>       Protocol myhttps = new Protocol("https",
>                            new
> ManualSSLProtocolSocketFactory(ksTrustStore, null, ""),
>                                             443);
>       httpclient.getHostConfiguration().setHost("
> <https://www.verisign.com/> https://www.verisign.com/", 443, myhttps);
> }
> 
> httpclient.executeMethod(httpget);
> 
>         Am I doing something wrong? The error message is:
>  
> java.lang.RuntimeException: Unexpected error:
> java.security.InvalidAlgorithmParameterException: the trustAnchors
> parameter must be non-empty
> 
> 
> Thank you,
> Milan 


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


Mime
View raw message