Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.4.0
-
Fix Version/s: 1.4.1
-
Component/s: Transport: TCP / UDP / SSL / Multicast
-
Labels:None
-
Similar Issues:None
Description
TcpConnector includes a pool for sockets and a factory abstraction (TcpSocketFactory). The SslConnector, which subclasses TcpConnector, doesn't use these. Instead sockets are created in the message dispatcher.
Apart from general problems with code duplication and related issues, this means that the getOutputStream() method that SslConnector inherits from TcpConnector will not work (I have not tested this, but note that no SSL tests exist for that functionality).
I believe that it would be relatively simple (a few days work - I'm still on a fairly steep learning curve!) to refactor this code so that TlsSupport generates an appropriate SSL socket factory in SslConnector, setting it in the super class (TcpConnector.setSocketFactory()).
This would then mean that SSL and TCP sockets become "identical" (distinguished only by the injected factory for sockets). They could then have the same support classes and you would get streaming (etc) "for free".
I suspect there may be similar issues with HTTP/HTTPS - I haven't looked there yet. Also, this only integrates sockets for sending. It seems likely that handling sockets for receiving could also be unified in the same way, but again I haven't looked at this in detail.
I am spinning this off the email SSL work (MULE-855) because it's a major change to the SSL component and I'm not sure I am right in my arguments above (comments please!).
This makes sense. Since I already converted the other 'socket' trasports I can probably do this pretty quickly. If I don't make a move on it please feel free to pick it up