8171900: javax/net/ssl/SSLSession/SessionTimeOutTests.java failed with "SSLHandshakeException: Remote host terminated the handshake"

The fix takes some code patterns from SSLSocketTemplate to deal with possible SSLHandshakeException and SocketTimeoutException, and it also resolves a potential mismatch on the connections between the clients and the servers.

Reviewed-by: xuelei
1 file changed