1 /*
2  * Copyright 2014-2020 Amazon Technologies, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *    http://aws.amazon.com/apache2.0
9  *
10  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
11  * OR CONDITIONS OF ANY KIND, either express or implied. See the
12  * License for the specific language governing permissions and
13  * limitations under the License.
14  */

15 package com.amazonaws.http.conn.ssl;
16
17 /**
18  * TLS protocols arranged in descending order of security preference in terms of
19  * their ordinal numbers. See <a href=
20  * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#jssenames"
21  * >JSSE Standard Names</a>.
22  */

23 enum TLSProtocol {
24     TLSv1_2("TLSv1.2"), // most secure/preferred
25     TLSv1_1("TLSv1.1"),
26     TLSv1("TLSv1"),
27     TLS("TLS"),         // least secure/preferred, but acceptable
28     ;
29     private final String protocolName;
30
31     private TLSProtocol(String protocolName) {
32         this.protocolName = protocolName;
33     }
34
35     /**
36      * Returns the corresponding TLS protocol name as per the <a href=
37      * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#jssenames"
38      * >JSSE Standard Names</a>
39      */

40     String getProtocolName() {
41         return protocolName;
42     }
43 }