DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21257>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21257

[HttpClient][patch]A more flexible SSLProtocolSocketFactory WRT SSLSocketFactory.

           Summary: [HttpClient][patch]A more flexible
                    SSLProtocolSocketFactory WRT SSLSocketFactory.
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: HttpClient
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When we created our SSL foundation using HttpClient, I missed a constructor in
the class "SSLProtocolSocketFactory" (org.apache.commons.httpclient.protocol).
This factory creates SSLSockets, but it always uses
"javax.net.ssl.SSLSocketFactory.getDefault()" as the factory.
 
This default implementation works with the default mechanism of Sun which is not
very flexible when you want to add trusted certificated to the trusted root, or
when you want to provide client certificates to a host you connect to.
If you _do_ want to be in control of these two mechanisms, you can create your
own TrustManager and KeyManager, but you also need to create a SocketFactory
that will use these. I have written all of these and it works fine, but there is
no way of specifying what SocketFactory Apache's HttpClient should use. It
always picks "javax.net.ssl.SSLSocketFactory.getDefault()".
 
Actually, there _is_ a way to change the default SSLSocketFactory, but that
involves changing a security property in the Java security properties file. Not
so nice.
 
Currently, I have made my own implementation in
com.seagullsw.toolkit.net.HttpClientSecureProtocolSocketFactory where I copied
the 'createSocket' methods from Apache's source ( bad me :-( ). In there, I also
have some logic to check the CommonName of the server-certificate against the
host, but I can move that to somewhere else.
 
So, what I would like is a constructor in
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory, that takes a
javax.net.ssl.SSLSocketFactory as argument and uses it when a socket is created. 

Attaching patch.

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

Reply via email to