Kumar,

What's sURLString value? Make sure it is an absolute URL (like
"https://targethost/whatever";), not a relative one (like "/whatever").
If my guess is wrong, please produce a debug/wire log of the HTTP
session and post it to this list

Oleg

On Wed, 2004-11-24 at 11:05 -0800, KOTA, KUMAR (SBCSI) wrote:
> Hi Oleg,
> 
>    For some reason, my  getSSLContext() (in
> AuthSSLProtocolSocketFactory) does not seem to be getting called and no
> exceptions are being thrown.  Have you encountered this issue?  The code
> below describes how I call my executeMethod().  I have changed nothing
> in the AuthSSLProtocolSocketFactory() (I am using HttpClient 2.0.2).
> 
> //getting all the required fields
> String baseDirectory = TAPConstants.sTAPBBTBASEDIRECTORY;
> String keyStorePassword = TAPConstants.sTAPKEYSTOREPASSWORD; 
> String keyStoreFile = TAPConstants.sTAPKEYSTOREFILE;
> String trustStorePassword = keyStorePassword;  
> String trustStoreFile = TAPConstants.sTAPTRUSTSTOREFILE; 
> 
> //creating string "file:C:/kumar/KEYSTORE" and
> "file:C:/kumar/TRUSTSTORE"                    
> String keyStoreString = "file:" + baseDirectory + "\\" + keyStoreFile;
> String trustStoreString = "file:" + baseDirectory + "\\" +
> trustStoreFile;
> 
> //setting up protocol and registering it                      
> Protocol authhttps = new Protocol("https",  
>               new AuthSSLProtocolSocketFactory(
>               new URL(keyStoreString), keyStorePassword,
>                       new URL(trustStoreString), trustStorePassword), 443); 
> Protocol.registerProtocol("https", authhttps);
>                       
> // Create an instance of HttpClient.
> HttpClient client = new HttpClient();
>               
> //Setting timeout
> client.setTimeout(timeoutVal);
> 
> // Create a method instance.
> GetMethod method = new GetMethod(sURLString);
> 
> // Execute the method.
> int statusCode = client.executeMethod(method);
> 
> 
> Thank you,
> Kumar
> 
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 23, 2004 3:05 PM
> To: HttpClient Project
> Subject: RE: Keystore and TrustStore
> 
> 
> Kumar,
> 
> This method will be called internally when establishing connection to
> the target server. All you have to do is to set up the required key
> store and/or trust store, create AuthSSLProtocolSocketFactory object,
> create and register a Protocol object with the given socket factory.
> HttpClient will do the rest
> 
> Oleg
> 
> On Tue, 2004-11-23 at 12:17 -0800, KOTA, KUMAR (SBCSI) wrote:
> > Hi Oleg,
> > 
> >   Thank you, that is precisely what I am loooking for...just had a
> quick
> > question regarding the getSSLContext() (in
> AuthSSLProtocolSocketFactory),
> > this is the method I assume triggers the truststore and keystore set
> up and
> > validation.  Is this method called by executeMethod()? Or does this
> need to
> > be called explicitly?
> > 
> > Thank you,
> > Kumar Kota
> > SBC Information Technology
> > [EMAIL PROTECTED]
> > (925) 901-6898
> > 
> > 
> > -----Original Message-----
> > From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, November 23, 2004 12:42 AM
> > To: HttpClient Project
> > Subject: Re: Keystore and TrustStore
> > 
> > 
> > Kumar,
> > 
> > Have a look at the AuthSSLProtocolSocketFactory:
> > 
> >
> http://cvs.apache.org/viewcvs.cgi/jakarta-commons/httpclient/src/contrib
> /org
> >
> /apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java
> ?rev
> > =1.1.2.1&only_with_tag=HTTPCLIENT_2_0_BRANCH&view=markup
> > 
> > This may be exactly what you want
> > 
> > Oleg
> > 
> > On Mon, Nov 22, 2004 at 04:21:29PM -0800, KOTA, KUMAR (SBCSI) wrote:
> > > Hi,
> > > 
> > >    This is more of a features question, but I was wondering if
> > > httpclient somehow can handle a keystore and truststore when making
> > > secure SSL connections?
> > > 
> > > Thank you,
> > > Kumar
> > > 
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to