Hi,

> In my application I am extending Socket to override getInputStream and 
> getOutputStream to add custom low-level "filtering". I use this socket in my 
> custom ProtocolSocketFactory that is registered to httpclient with 
> Protocol.registerProtocol. This is for HTTP protocol. Now I need the same 
> with HTTPS protocol. I use EasySSLProtocolSocketFactory from contrib. The 
> problem is that I can't implement MyCustomSSLSocket that extend SSLSocket, 
> because this SSLSocket is created by SSLContext -> SSLSocketFactory. 
> javax.net.SSLContext is abstract. Any hints to solve this problem? Should I 
> use some other JSSE like Jessie?

Have you considered using a wrapper instead of extending the class
that gets instantiated? In other words:
- MyCustomSSLSocket extends SSLSocket
- keep the wrapped socket from SSLSocketFactory as an attribute
- delegate *all* calls of the SSLSocket class to the wrapped socket
- add your custom modifications to the get{In|Out}putStream methods

Some IDEs have tools that can generate basic wrappers automatically.
One of the few occasions where I admit that IDEs have advantages :-)

hope that helps,
  Roland


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

Reply via email to