8166878: Connection reset during TLS handshake
authorigerasim
Sun, 09 Oct 2016 14:38:30 +0300
changeset 43210 570fbef3a53b
parent 43209 98dd38700c36
child 43211 f264afd5082c
8166878: Connection reset during TLS handshake Reviewed-by: xuelei Contributed-by: xuelei.fan@oracle.com
jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java
--- a/jdk/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java	Thu Oct 06 10:31:41 2016 -0700
+++ b/jdk/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");