1 /*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
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 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 package software.amazon.awssdk.http.apache.internal.conn;
17
18 import software.amazon.awssdk.annotations.SdkInternalApi;
19
20 /**
21 * TLS protocols arranged in descending order of security preference in terms of
22 * their ordinal numbers. See <a href=
23 * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#jssenames"
24 * >JSSE Standard Names</a>.
25 */
26 @SdkInternalApi
27 enum TlsProtocol {
28 TLS_V1_2("TLSv1.2"),
29 // most secure/preferred
30 TLS_V1_1("TLSv1.1"),
31 TLS_V1("TLSv1"),
32 TLS("TLS"),
33 // least secure/preferred, but acceptable
34 ;
35 private final String protocolName;
36
37 TlsProtocol(String protocolName) {
38 this.protocolName = protocolName;
39 }
40
41 /**
42 * Returns the corresponding TLS protocol name as per the <a href=
43 * "http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#jssenames"
44 * >JSSE Standard Names</a>
45 */
46 String getProtocolName() {
47 return protocolName;
48 }
49 }
50