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: virtual protocol registration with customSSLProtocolSocketFactory ignored
Date Fri, 04 Aug 2006 14:42:04 GMT
On Fri, 2006-08-04 at 19:54 +0530, Adalbert Wysocki wrote:
> Thanks Oleg! It helps but...
> 
> Do you recommend using a HostConfiguration configured with my particular
> Protocol (and the socket factory) instead of registering the protocol
> with Protocol.registerProtocol(...)?
> 
> Or
> 
> Using as parameter to the PostMethod a relative URI without any scheme
> and starting from the first / ?
> 

Aldo,
It very much depends upon your design consideration. If you want a
Protocol instance to apply globally, it should be registered using
Protocol#registerProtocol method. If, however, you want a Protocol
instance to apply to a specific host, then you should be using a custom
HostConfiguration parameter.

> Is there a milestone to solve this issue?
> Thanks,
> 

This issue simply highlights deficiencies of the 3.x API. There's not
much that can be done about it without breaking the API compatibility.

We are planning to address this issue in HttpClient 4.0, which will be
based on a completely new set of low level components [1]

Oleg

[1] http://jakarta.apache.org/httpcomponents/



> Aldo
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org] 
> Sent: Friday, August 04, 2006 7:32 PM
> To: HttpClient User Discussion
> Subject: Re: virtual protocol registration with
> customSSLProtocolSocketFactory ignored
> 
> On Fri, 2006-08-04 at 19:16 +0530, Adalbert Wysocki wrote:
> > Hi,
> > 
> > Having an endless handshake going though the proxy with SSL and client
> > certificate authentication I upgraded from HTTPClient 2.0.2 to 3.0.1.
> > 
> > With 3.0.1 the handshake is working BUT the authentication of the
> client
> > by the server using the client certificate is not working anymore
> > whereas it was before.
> > 
> > Debugging it appears that the default SSLProtocolSocketFactory is used
> > instead of the one I register. It was working fine with 2.0.2 and does
> > not with 3.0.1.
> > 
> > The protocolInUse variable in HttpConnection during the open() method
> > has a wrong value...
> > 
> > Registering my custom Factory with the "https" scheme protocol in
> > addition or instead my custom "httpsin0" schema protocol is a
> > workaround...
> > 
> >  
> > 
> > Is it a known issue or did I missed something?
> > 
> 
> Aldo,
> It is a known issue. Please make sure you are using relative URLs when
> passing a custom HostConfiguration as a parameter to the
> HttpClient#executeMethod method. 
> 
> Hope this helps
> 
> Oleg
> 
> >  
> > 
> > Thanks for your help,
> > 
> > Aldo
> > 
> >  
> > 
> > -------------
> > 
> >  
> > 
> > My AuthSSLProtocolSocketFactory creates the keystore, keymanagers and
> > trustmanagers.
> > 
> > My application registers a custom protocol with "httpsin0" schema.
> > 
> >  
> > 
> > ProtocolSocketFactory socketFactory = new
> AuthSSLProtocolSocketFactory(
> > 
> >                         keyStoreURL, storePass, keyPass,
> trustStoreURL,
> > 
> >                         trustStorePass);
> > 
> >  
> > 
> >             Protocol authhttps = new Protocol("https", socketFactory,
> > getPort());
> > 
> >             Protocol.registerProtocol('httpsin0", authhttps);
> > 
> >  
> > 
> > ... 
> > 
> >  
> > 
> > HttpClient httpclient = new HttpClient();
> > 
> > String url = "httpsin0://my.secure.server.url/zzzzzzzzzzzz"
> > 
> >                         
> > 
> > PostMethod httpPost = new PostMethod(url);
> > 
> > InputStreamRequestEntity isRequestEntity = new
> > InputStreamRequestEntity(requestMsg);
> > 
> > httpPost.setRequestEntity(isRequestEntity);
> > 
> >  
> > 
> > httpclient.executeMethod(httpPost);
> > 
> >  
> > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 


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