I’m developing a Java based P2P application where the peers are communicating with each using a library called ice4j and it’s custom socket called PsuedoTCPSocket.
I now want to add SSL support to the application. PsuedoTCPSocket extends java.net.Socket so think it should possible to just use a SSLSocket on top of that socket. However I’m not able to find any way to create SSLSocket-instances using a custom underlying Socket. Is this possible and if so how do I achieve it?
If your
PseudoTCPSocketextendsjava.net.Socket(and doesn’t break its API), you should be able to upgrade it to anSSLSocketusingSSLSocketFactory.createSocket(Socket s, String host, int port, boolean autoClose).