How can i set the local port when creating a SSLSocket?
This is how i create the socket:
SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
SSLSocket s = (SSLSocket) factory.createSocket(SERVER_ADDRESS, SERVER_PORT);
It seems that createSocket method doesnt have a parameter for setting LOCAL_PORT and the constructor of SSLSocket doesnt work either.
Thanks
There is a variant of the createSocket method which is inherited by SSLSocketFactory from SocketFactory which takes a host and a port. See the documentation.