My code is here:
SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, getAllCerts(), new SecureRandom()); SSLSocketFactory factory = sslContext.getSocketFactory(); mSocket = (SSLSocket) factory.createSocket("myhost.com", socketPort[index]);
I need to check the ports table and select the open one. Everything works fine, but on createSocket () my application frees up a lot of time. If I have 5 ports, and the latter is an open connection, it takes about 3 minutes.
How to set a timeout on SSLSocketFactory to speed up the connection?
source share