8166878: Connection reset during TLS handshake

Reviewed-by: xuelei
This commit is contained in:
Xuelei Fan 2016-10-09 14:38:30 +03:00 committed by Ivan Gerasimov
parent 698c52a1eb
commit 90e6cda73c

View File

@ -673,8 +673,11 @@ final class ClientHandshaker extends Handshaker {
} else {
// we wanted to resume, but the server refused
//
// Invalidate the session in case of reusing next time.
session.invalidate();
// Invalidate the session for initial handshake in case
// of reusing next time.
if (isInitialHandshake) {
session.invalidate();
}
session = null;
if (!enableNewSession) {
throw new SSLException("New session creation is disabled");