commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Sangster" <>
Subject RE: [httpclient 3.0 rc1] - Protocol.registerProtocol
Date Tue, 28 Jun 2005 13:11:53 GMT
Problem appears to have been resolved.   When defining my new protocol
object I was assigning it as follows

new Protocol( "https", new EasySSLSocketFactory(), 443 );

when it should be

new Protocol( "myhttps", new EasySSLSocketFactory(), 443 );

Now when I register it as "myhttps", and pass in an "myhttps://" style URL,
everything works okay.   I was thinking that I needed to have "https" in
order to make it be SSL, but forgot that the SSLContext is what concerns
itself about that.


-----Original Message-----
From: James Sangster [] 
Sent: Tuesday, June 28, 2005 8:50 AM
To: 'Jakarta Commons Users List'
Subject: [httpclient 3.0 rc1] - Protocol.registerProtocol


I started off developing my current project utilizing 3.0 rc1 of httpclient.
It's all working fine, and perhaps the error I'm getting is fixed in rc3,
but here goes.

I'm attempting to register a new protocol which allows self-signed
certificates to be accepted without saying "no trusted certificate found".
I've based this code off of the EasySSLSocketFactory (sp?).   It works
beautifully when I register this with the string "https", as in

Protocol.registerProtocol( "https", myProtocol );

However... the trouble for me starts when I register this with a different
name, say, "myhttps", so as to avoid replacing the default https processing
as I still want that available for most cases.   If I pass in a URL with
this prefix, it picks up the right ProtocolSocketFactory class (determined
through the debugger), but it's methods are never called (writing out some
System.out.println to test this).   It seems that it's defaulting back to
the default Sun https checking code as I get the exception of "no trusted
certificate found".

Has anyone else encountered this problem?    Once again, if the "https"
protocol is overwritten, it works fine, but if I register under anything
different then it defaults to the basic https checking which returns an

Any help or even shared experienced would be welcome.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message