diff -r fd9c0e3b34eb -r 6464c8e62a18 jdk/src/share/classes/sun/security/ssl/ClientHandshaker.java --- a/jdk/src/share/classes/sun/security/ssl/ClientHandshaker.java Fri Oct 29 12:35:07 2010 +0200 +++ b/jdk/src/share/classes/sun/security/ssl/ClientHandshaker.java Sat Oct 30 18:39:17 2010 +0800 @@ -345,9 +345,10 @@ // check if the server selected protocol version is OK for us ProtocolVersion mesgVersion = mesg.protocolVersion; - if (enabledProtocols.contains(mesgVersion) == false) { - throw new SSLHandshakeException - ("Server chose unsupported or disabled protocol: " + mesgVersion); + if (!isNegotiable(mesgVersion)) { + throw new SSLHandshakeException( + "Server chose unsupported or disabled protocol: " + + mesgVersion); } // Set protocolVersion and propagate to SSLSocket and the @@ -1022,7 +1023,7 @@ SessionId sessionId = SSLSessionImpl.nullSession.getSessionId(); // a list of cipher suites sent by the client - CipherSuiteList cipherSuites = enabledCipherSuites; + CipherSuiteList cipherSuites = getActiveCipherSuites(); // set the max protocol version this client is supporting. maxProtocolVersion = protocolVersion; @@ -1057,8 +1058,7 @@ session = null; } - if ((session != null) && - (enabledProtocols.contains(sessionVersion) == false)) { + if ((session != null) && !isNegotiable(sessionVersion)) { if (debug != null && Debug.isOn("session")) { System.out.println("%% can't resume, protocol disabled"); } @@ -1088,7 +1088,7 @@ */ if (!enableNewSession) { if (session == null) { - throw new SSLException( + throw new SSLHandshakeException( "Can't reuse existing SSL client session"); } @@ -1105,7 +1105,7 @@ } if (session == null && !enableNewSession) { - throw new SSLException("No existing session to resume"); + throw new SSLHandshakeException("No existing session to resume"); } // exclude SCSV for secure renegotiation @@ -1131,7 +1131,7 @@ } if (!negotiable) { - throw new SSLException("No negotiable cipher suite"); + throw new SSLHandshakeException("No negotiable cipher suite"); } // create the ClientHello message