MySQL 8.0.39
Source Code Documentation
tls_ciphers.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2023, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef TLS_CIPHERS_INCLUDED
27#define TLS_CIPHERS_INCLUDED
28
29namespace {
30
31/**
32 Configuring list of ciphers
33
34 TLSv1.2
35 =======
36 Server: Specify in folllowing order:
37 1. Blocked ciphers
38 2. Approved ciphers
39
40 Client: Specify in following order:
41 1. Blocked ciphers
42 2. Approved ciphers
43 3. Client specific ciphers
44
45 TLSv1.3
46 =======
47 Server: Specify in folllowing order:
48 1. Blocked ciphers (None atm)
49 2. Approved ciphers
50
51 Client: Specify in following order:
52 1. Blocked ciphers (None atm)
53 2. Approved ciphers
54 3. Client specific ciphers (None atm)
55
56*/
57
58/*
59 List of TLSv1.3 ciphers in order to their priority.
60 Addition to the list must be done keeping priority of the
61 new cipher in mind.
62 The last entry must not contain a trailing ":".
63
64 Current criteria for inclusion is:
65 1. Must provide Perfect Forward Secrecy
66 2. Uses SHA2 in cipher/certificate
67 3. Uses AES in GCM or any other AEAD algorithms/modes
68*/
69const char default_tls13_ciphers[] = {
70 "TLS_AES_128_GCM_SHA256:"
71 "TLS_AES_256_GCM_SHA384:"
72 "TLS_CHACHA20_POLY1305_SHA256:"
73 "TLS_AES_128_CCM_SHA256"};
74
75/*
76 List of TLSv1.2 ciphers in order to their priority.
77 Addition to the list must be done keeping priority of the
78 new cipher in mind.
79 The last entry must not contain a trailing ":".
80
81 Current criteria for inclusion is:
82 1. Must provide Perfect Forward Secrecy
83 2. Uses SHA2 in cipher/certificate
84 3. Uses AES in GCM or any other AEAD algorithms/modes
85*/
86const char default_tls12_ciphers[] = {
87 "ECDHE-ECDSA-AES128-GCM-SHA256:"
88 "ECDHE-ECDSA-AES256-GCM-SHA384:"
89 "ECDHE-RSA-AES128-GCM-SHA256:"
90 "ECDHE-RSA-AES256-GCM-SHA384:"
91 "ECDHE-ECDSA-CHACHA20-POLY1305:"
92 "ECDHE-RSA-CHACHA20-POLY1305:"
93 "ECDHE-ECDSA-AES256-CCM:"
94 "ECDHE-ECDSA-AES128-CCM:"
95 "DHE-RSA-AES128-GCM-SHA256:"
96 "DHE-RSA-AES256-GCM-SHA384:"
97 "DHE-RSA-AES256-CCM:"
98 "DHE-RSA-AES128-CCM:"
99 "DHE-RSA-CHACHA20-POLY1305"};
100
101/*
102 Following ciphers (or categories of ciphers) are not permitted
103 because they are too weak to provide required security.
104
105 New cipher/category can be added at any position.
106
107 Care must be taken to prefix cipher/category with "!"
108*/
109const char blocked_tls12_ciphers[] = {
110 "!aNULL:"
111 "!eNULL:"
112 "!EXPORT:"
113 "!LOW:"
114 "!MD5:"
115 "!DES:"
116 "!3DES:"
117 "!RC2:"
118 "!RC4:"
119 "!PSK:"
120 "!DH-RSA-AES128-SHA256:"
121 "!DH-RSA-AES256-SHA256:"
122 "!DH-DSS-AES128-SHA256:"
123 "!DH-DSS-AES128-SHA:"
124 "!DH-DSS-AES256-SHA:"
125 "!DH-DSS-AES256-SHA256:"
126 "!DH-RSA-AES128-SHA:"
127 "!DH-RSA-AES256-SHA:"
128 "!DH-DSS-AES128-GCM-SHA256:"
129 "!DH-DSS-AES256-GCM-SHA384:"
130 "!DH-RSA-AES128-GCM-SHA256:"
131 "!DH-RSA-AES256-GCM-SHA384"};
132
133/*
134 Following ciphers are added to the list of permissible ciphers
135 while configuring the ciphers on client side.
136
137 This is done to provide backward compatbility.
138*/
140 "ECDHE-ECDSA-AES256-CCM8:"
141 "ECDHE-ECDSA-AES128-CCM8:"
142 "DHE-RSA-AES256-CCM8:"
143 "DHE-RSA-AES128-CCM8:"
144 "ECDHE-ECDSA-AES128-SHA256:"
145 "ECDHE-RSA-AES128-SHA256:"
146 "ECDHE-ECDSA-AES256-SHA384:"
147 "ECDHE-RSA-AES256-SHA384:"
148 "DHE-DSS-AES256-GCM-SHA384:"
149 "DHE-DSS-AES128-GCM-SHA256:"
150 "DHE-DSS-AES128-SHA256:"
151 "DHE-DSS-AES256-SHA256:"
152 "DHE-RSA-AES256-SHA256:"
153 "DHE-RSA-AES128-SHA256:"
154 "DHE-RSA-CAMELLIA256-SHA256:"
155 "DHE-RSA-CAMELLIA128-SHA256:"
156 "ECDHE-RSA-AES128-SHA:"
157 "ECDHE-ECDSA-AES128-SHA:"
158 "ECDHE-RSA-AES256-SHA:"
159 "ECDHE-ECDSA-AES256-SHA:"
160 "DHE-DSS-AES128-SHA:"
161 "DHE-RSA-AES128-SHA:"
162 "DHE-RSA-AES256-SHA:"
163 "DHE-DSS-AES256-SHA:"
164 "DHE-RSA-CAMELLIA256-SHA:"
165 "DHE-RSA-CAMELLIA128-SHA:"
166 "ECDH-ECDSA-AES128-SHA256:"
167 "ECDH-RSA-AES128-SHA256:"
168 "ECDH-RSA-AES256-SHA384:"
169 "ECDH-ECDSA-AES256-SHA384:"
170 "ECDH-ECDSA-AES128-SHA:"
171 "ECDH-ECDSA-AES256-SHA:"
172 "ECDH-RSA-AES128-SHA:"
173 "ECDH-RSA-AES256-SHA:"
174 "AES128-GCM-SHA256:"
175 "AES128-CCM:"
176 "AES128-CCM8:"
177 "AES256-GCM-SHA384:"
178 "AES256-CCM:"
179 "AES256-CCM8:"
180 "AES128-SHA256:"
181 "AES256-SHA256:"
182 "AES128-SHA:"
183 "AES256-SHA:"
184 "CAMELLIA256-SHA:"
185 "CAMELLIA128-SHA:"
186 "ECDH-ECDSA-AES128-GCM-SHA256:"
187 "ECDH-ECDSA-AES256-GCM-SHA384:"
188 "ECDH-RSA-AES128-GCM-SHA256:"
189 "ECDH-RSA-AES256-GCM-SHA384"};
190
191} // namespace
192
193#endif /* TLS_CIPHERS_INCLUDED */
const char blocked_tls12_ciphers[]
Definition: tls_ciphers.h:109
const char default_tls13_ciphers[]
Configuring list of ciphers.
Definition: tls_ciphers.h:69
const char default_tls12_ciphers[]
Definition: tls_ciphers.h:86
const char additional_client_ciphers[]
Definition: tls_ciphers.h:139