changeset 16518:8898d354ce30

8166878: Connection reset during TLS handshake Reviewed-by: xuelei Contributed-by: xuelei.fan@oracle.com
author igerasim
date Sun, 09 Oct 2016 14:38:30 +0300
parents bae21daec821
children 874d9919be26
files src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java	Thu Oct 06 10:31:41 2016 -0700
+++ b/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java	Sun Oct 09 14:38:30 2016 +0300
@@ -673,8 +673,11 @@
             } 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");