hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Milan Tomic" <mi...@setcce.org>
Subject RE: SSL
Date Thu, 21 Apr 2005 07:37:05 GMT

It works fine with Java 1.4.2 It works fine under Java 1.4.2, even if I
use cacerts from Java 1.5.

Does anyone else have troubles with Java 1.5?

Best regards,
Milan


> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org] 
> Sent: Wednesday, April 20, 2005 10:44 PM
> To: HttpClient User Discussion
> Subject: Re: SSL
> 
> 
> 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
> 



---------------------------------------------------------------------
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