src/java.base/share/classes/sun/security/ssl/ProtocolList.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -122,12 +122,13 @@
* client hello and protocol versions supported by the server.
*/
ProtocolVersion selectProtocolVersion(ProtocolVersion protocolVersion) {
ProtocolVersion selectedVersion = null;
for (ProtocolVersion pv : protocols) {
- if (pv.v > protocolVersion.v) {
- break; // Safe to break here as this.protocols is sorted
+ if (pv.compareTo(protocolVersion) > 0) {
+ break; // Safe to break here as this.protocols is sorted,
+ // and DTLS and SSL/TLS protocols are not mixed.
}
selectedVersion = pv;
}
return selectedVersion;