< prev index next >

src/java.base/share/classes/sun/security/ssl/TransportContext.java

Print this page

        

@@ -37,10 +37,11 @@
 import javax.net.ssl.HandshakeCompletedEvent;
 import javax.net.ssl.HandshakeCompletedListener;
 import javax.net.ssl.SSLEngineResult.HandshakeStatus;
 import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLSocket;
+import sun.security.ssl.SupportedGroupsExtension.NamedGroup;
 
 /**
  * SSL/(D)TLS transportation context.
  */
 class TransportContext implements ConnectionContext {

@@ -156,23 +157,18 @@
                 byte type = HandshakeContext.getHandshakeType(this,
                         plaintext);
                 if (handshakeContext == null) {
                     if (type == SSLHandshake.KEY_UPDATE.id ||
                             type == SSLHandshake.NEW_SESSION_TICKET.id) {
-                        if (!isNegotiated) {
-                            throw fatal(Alert.UNEXPECTED_MESSAGE,
-                                    "Unexpected unnegotiated post-handshake" +
-                                            " message: " +
-                                            SSLHandshake.nameOf(type));
-                        }
-                        if (type == SSLHandshake.KEY_UPDATE.id &&
-                                !protocolVersion.useTLS13PlusSpec()) {
+                        if (isNegotiated &&
+                                protocolVersion.useTLS13PlusSpec()) {
+                            handshakeContext = new PostHandshakeContext(this);
+                        } else {
                             throw fatal(Alert.UNEXPECTED_MESSAGE,
                                     "Unexpected post-handshake message: " +
                                     SSLHandshake.nameOf(type));
                         }
-                        handshakeContext = new PostHandshakeContext(this);
                     } else {
                         handshakeContext = sslConfig.isClientMode ?
                                 new ClientHandshakeContext(sslContext, this) :
                                 new ServerHandshakeContext(sslContext, this);
                         outputRecord.initHandshaker();
< prev index next >