You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ortwin Glück <or...@nose.ch> on 2002/07/02 15:14:06 UTC

[httpclient] Volunteering to make SSL socket factory more flexible

Hi

At the moment the SSL socket is created with a call to 
SSLSocketFactory.getDefault().createSocket(host,port) in HttpConnection. 
Unfortunately this is not flexible enough when you want to use 
implementations different from Sun's JSSE (which is subject to export 
restrictions and does not allow instatiation of other implementations 
with the getDefault() method). As our company uses SSLava 
(www.phaos.com) we need a solution that allows to specify the 
SSLSocketFactory to use.

We would like to make the following changes:
- HttpConnection: add setSSLSocketFactory(SSLSocketFactory)
An SSL connection will use the specified factory or the 
SSLFactory.getDefault() otherwise. The factory must be set before open() 
is called.

- HttpClient: add setSSLSocketFactory(SSLSocketFactory)
Acts as a facade to the underlying HttpConnection. The factory must be 
set before startSession(...) is called.

These changes are compatible with existing applications.

Please let us know if you would like to incorporate the changes. We will 
provide the patches within a couple of days.

Best Regards

Ortwin Glück

-- 
_________________________________________________________________
  NOSE applied intelligence ag      [perspectix-nose digital b.i]
                                    [www]      http://www.nose.ch
  ortwin glück                      [email] ortwin.glueck@nose.ch
  hardturmstrasse 171               [office]      +41-1-277 57 35
  8005 zurich                       [fax]         +41-1-277 57 12
  switzerland



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [httpclient] Volunteering to make SSL socket factory more flexible

Posted by Simon Roberts <si...@fifthweb.net>.
> At the moment the SSL socket is created with a call to
> SSLSocketFactory.getDefault().createSocket(host,port) in HttpConnection.
> Unfortunately this is not flexible enough when you want to use
> implementations different from Sun's JSSE (which is subject to export
> restrictions and does not allow instatiation of other implementations
> with the getDefault() method). As our company uses SSLava
> (www.phaos.com) we need a solution that allows to specify the
> SSLSocketFactory to use.
>
> We would like to make the following changes:
> - HttpConnection: add setSSLSocketFactory(SSLSocketFactory)
> An SSL connection will use the specified factory or the
> SSLFactory.getDefault() otherwise. The factory must be set before open()
> is called.
>
> - HttpClient: add setSSLSocketFactory(SSLSocketFactory)
> Acts as a facade to the underlying HttpConnection. The factory must be
> set before startSession(...) is called.
>
> These changes are compatible with existing applications.
>
> Please let us know if you would like to incorporate the changes. We will
> provide the patches within a couple of days.


Yup!  I've done my own fugly patch to achieve that, but your solution looks
nicer.

I would request that you also apply the change to HttpMultiClient and
HttpConnectionManager, so that it stores the socket factory, then applies
the setSSLSocketFactory to HttpConnections as they are created - see
HttpConnectionManager.getConnection()

Unless you were talking about statics?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>