You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Oleg Kalnichevski <ol...@apache.org> on 2006/08/04 16:01:32 UTC
Re: virtual protocol registration with custom
SSLProtocolSocketFactory 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