changeset 8612:f85008ee39a1

8166878: Connection reset during TLS handshake Reviewed-by: xuelei Contributed-by: xuelei.fan@oracle.com
author igerasim
date Sun, 09 Oct 2016 14:45:49 +0300
parents 30d19589183e
children bee8851bd076
files src/share/classes/sun/security/ssl/ClientHandshaker.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/ssl/ClientHandshaker.java	Wed Feb 01 06:31:03 2017 +0000
+++ b/src/share/classes/sun/security/ssl/ClientHandshaker.java	Sun Oct 09 14:45:49 2016 +0300
@@ -613,8 +613,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");