As of java 1.7, the following does not throw the exception indicated in the question:
String host = "example.com"; int port = 12345; int connectTimeout = 5000; SSLSocket socket = (SSLSocket)SSLSocketFactory.getDefault().createSocket(); socket.connect(new InetSocketAddress(host, port), connectTimeout); socket.startHandshake();
therefore it works as usual.
source share