jdk/src/share/classes/sun/security/ssl/ProtocolList.java
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 7990 57019dc81b66
child 9275 1df1f7dfab7f
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 7990
diff changeset
     2
 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.security.ssl;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * A list of ProtocolVersions. Also maintains the list of supported protocols.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * Instances of this class are immutable. Some member variables are final
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * and can be accessed directly without method accessors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * @author  Andreas Sterbenz
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * @since   1.4.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
final class ProtocolList {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    private static final ProtocolList SUPPORTED;
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    41
    private static final ProtocolList CLIENT_DEFAULT;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    42
    private static final ProtocolList SERVER_DEFAULT;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    44
    // the sorted protocol version list
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    45
    private final ArrayList<ProtocolVersion> protocols;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    46
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    private String[] protocolNames;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    // the minimum and maximum ProtocolVersions in this list
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    final ProtocolVersion min, max;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    // the format for the hello version to use
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    final ProtocolVersion helloVersion;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    ProtocolList(String[] names) {
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    56
        this(convert(names));
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    57
    }
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    58
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    59
    ProtocolList(ArrayList<ProtocolVersion> versions) {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    60
        this.protocols = versions;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    61
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    62
        if ((protocols.size() == 1) &&
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    63
                protocols.contains(ProtocolVersion.SSL20Hello)) {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    64
            throw new IllegalArgumentException("SSLv2Hello cannot be " +
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    65
                "enabled unless at least one other supported version " +
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    66
                "is also enabled.");
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    67
        }
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    68
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    69
        if (protocols.size() != 0) {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    70
            Collections.sort(protocols);
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    71
            min = protocols.get(0);
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    72
            max = protocols.get(protocols.size() - 1);
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    73
            helloVersion = protocols.get(0);
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    74
        } else {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    75
            min = ProtocolVersion.NONE;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    76
            max = ProtocolVersion.NONE;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    77
            helloVersion = ProtocolVersion.NONE;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    78
        }
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    79
    }
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    80
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    81
    private static ArrayList<ProtocolVersion> convert(String[] names) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        if (names == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
            throw new IllegalArgumentException("Protocols may not be null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        }
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    85
7990
57019dc81b66 7012003: diamond conversion for ssl
smarks
parents: 7043
diff changeset
    86
        ArrayList<ProtocolVersion> versions = new ArrayList<>(3);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        for (int i = 0; i < names.length; i++ ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            ProtocolVersion version = ProtocolVersion.valueOf(names[i]);
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    89
            if (versions.contains(version) == false) {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    90
                versions.add(version);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        }
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    93
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
    94
        return versions;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * Return whether this list contains the specified protocol version.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * SSLv2Hello is not a real protocol version we support, we always
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * return false for it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    boolean contains(ProtocolVersion protocolVersion) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        if (protocolVersion == ProtocolVersion.SSL20Hello) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        return protocols.contains(protocolVersion);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    /**
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   110
     * Return a reference to the internal Collection of CipherSuites.
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   111
     * The Collection MUST NOT be modified.
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   112
     */
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   113
    Collection<ProtocolVersion> collection() {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   114
        return protocols;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   115
    }
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   116
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   117
    /**
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   118
     * Select a protocol version from the list.
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   119
     *
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   120
     * Return the lower of the protocol version of that suggested by
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   121
     * the <code>protocolVersion</code> and the highest version of this
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   122
     * protocol list, or null if no protocol version is available.
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   123
     *
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   124
     * The method is used by TLS server to negotiated the protocol
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   125
     * version between client suggested protocol version in the
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   126
     * client hello and protocol versions supported by the server.
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   127
     */
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   128
    ProtocolVersion selectProtocolVersion(ProtocolVersion protocolVersion) {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   129
        ProtocolVersion selectedVersion = null;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   130
        for (ProtocolVersion pv : protocols) {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   131
            if (pv.v > protocolVersion.v) {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   132
                break;  // Safe to break here as this.protocols is sorted
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   133
            }
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   134
            selectedVersion = pv;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   135
        }
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   136
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   137
        return selectedVersion;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   138
    }
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   139
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   140
    /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * Return an array with the names of the ProtocolVersions in this list.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    synchronized String[] toStringArray() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        if (protocolNames == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            protocolNames = new String[protocols.size()];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            for (ProtocolVersion version : protocols) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                protocolNames[i++] = version.name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        }
51
6fe31bc95bbc 6600143: Remove another 450 unnecessary casts
martin
parents: 2
diff changeset
   151
        return protocolNames.clone();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        return protocols.toString();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    /**
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   159
     * Return the list of default enabled protocols.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     */
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   161
    static ProtocolList getDefault(boolean isServer) {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   162
        return isServer ? SERVER_DEFAULT : CLIENT_DEFAULT;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   163
    }
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   164
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   165
    /**
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   166
     * Return whether a protocol list is the original default enabled
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   167
     * protocols.  See: SSLSocket/SSLEngine.setEnabledProtocols()
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   168
     */
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   169
    static boolean isDefaultProtocolList(ProtocolList protocols) {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   170
        return protocols == CLIENT_DEFAULT || protocols == SERVER_DEFAULT;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * Return the list of supported protocols.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    static ProtocolList getSupported() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        return SUPPORTED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        if (SunJSSE.isFIPS()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            SUPPORTED = new ProtocolList(new String[] {
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   183
                ProtocolVersion.TLS10.name,
7043
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   184
                ProtocolVersion.TLS11.name,
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   185
                ProtocolVersion.TLS12.name
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   186
            });
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   187
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   188
            SERVER_DEFAULT = SUPPORTED;
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   189
            CLIENT_DEFAULT = new ProtocolList(new String[] {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                ProtocolVersion.TLS10.name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
            });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            SUPPORTED = new ProtocolList(new String[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                ProtocolVersion.SSL20Hello.name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                ProtocolVersion.SSL30.name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                ProtocolVersion.TLS10.name,
7043
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   197
                ProtocolVersion.TLS11.name,
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   198
                ProtocolVersion.TLS12.name
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   199
            });
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   200
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   201
            SERVER_DEFAULT = SUPPORTED;
7043
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   202
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   203
            /*
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   204
             * RFC 5246 says that sending SSLv2 backward-compatible
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   205
             * hello SHOULD NOT be done any longer.
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   206
             *
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   207
             * We are not enabling TLS 1.1/1.2 by default yet on clients
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   208
             * out of concern for interop with existing
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   209
             * SSLv3/TLS1.0-only servers.  When these versions of TLS
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   210
             * gain more traction, we'll enable them.
5e2d1edeb2c7 6916074: Add support for TLS 1.2
xuelei
parents: 7039
diff changeset
   211
             */
7039
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   212
            CLIENT_DEFAULT = new ProtocolList(new String[] {
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   213
                ProtocolVersion.SSL30.name,
6464c8e62a18 4873188: Support TLS 1.1
xuelei
parents: 5506
diff changeset
   214
                ProtocolVersion.TLS10.name
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
            });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
}