From a435de1f6e4b2a216b53debfb725b9fc48e13319 Mon Sep 17 00:00:00 2001 From: igerasim Date: Sun, 9 Oct 2016 14:45:49 +0300 Subject: [PATCH] 8166878: Connection reset during TLS handshake Reviewed-by: xuelei Contributed-by: xuelei.fan@oracle.com --- src/share/classes/sun/security/ssl/ClientHandshaker.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/share/classes/sun/security/ssl/ClientHandshaker.java b/src/share/classes/sun/security/ssl/ClientHandshaker.java index 4ff3dbe6b..0d5555245 100644 --- a/src/share/classes/sun/security/ssl/ClientHandshaker.java +++ b/src/share/classes/sun/security/ssl/ClientHandshaker.java @@ -621,8 +621,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"); -- GitLab