MySQL 8.0.46
Source Code Documentation
tls_ciphers.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2023, 2026, 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
29#include <openssl/opensslv.h>
30
31namespace {
32
33/**
34 Configuring list of ciphers
35
36 TLSv1.2
37 =======
38 Server: Specify in folllowing order:
39 1. Blocked ciphers
40 2. Approved ciphers
41
42 Client: Specify in following order:
43 1. Blocked ciphers
44 2. Approved ciphers
45 3. Client specific ciphers
46
47 TLSv1.3
48 =======
49 Server: Specify in folllowing order:
50 1. Blocked ciphers (None atm)
51 2. Approved ciphers
52
53 Client: Specify in following order:
54 1. Blocked ciphers (None atm)
55 2. Approved ciphers
56 3. Client specific ciphers (None atm)
57
58*/
59
60/*
61 List of TLSv1.3 ciphers in order to their priority.
62 Addition to the list must be done keeping priority of the
63 new cipher in mind.
64 The last entry must not contain a trailing ":".
65
66 Current criteria for inclusion is:
67 1. Must provide Perfect Forward Secrecy
68 2. Uses SHA2 in cipher/certificate
69 3. Uses AES in GCM or any other AEAD algorithms/modes
70*/
71const char default_tls13_ciphers[] = {
72 "TLS_AES_128_GCM_SHA256:"
73 "TLS_AES_256_GCM_SHA384:"
74 "TLS_CHACHA20_POLY1305_SHA256:"
75 "TLS_AES_128_CCM_SHA256"};
76
77/*
78 List of TLSv1.2 ciphers in order to their priority.
79 Addition to the list must be done keeping priority of the
80 new cipher in mind.
81 The last entry must not contain a trailing ":".
82
83 Current criteria for inclusion is:
84 1. Must provide Perfect Forward Secrecy
85 2. Uses SHA2 in cipher/certificate
86 3. Uses AES in GCM or any other AEAD algorithms/modes
87*/
88const char default_tls12_ciphers[] = {
89 "ECDHE-ECDSA-AES128-GCM-SHA256:"
90 "ECDHE-ECDSA-AES256-GCM-SHA384:"
91 "ECDHE-RSA-AES128-GCM-SHA256:"
92 "ECDHE-RSA-AES256-GCM-SHA384:"
93 "ECDHE-ECDSA-CHACHA20-POLY1305:"
94 "ECDHE-RSA-CHACHA20-POLY1305:"
95 "ECDHE-ECDSA-AES256-CCM:"
96 "ECDHE-ECDSA-AES128-CCM:"
97 "DHE-RSA-AES128-GCM-SHA256:"
98 "DHE-RSA-AES256-GCM-SHA384:"
99 "DHE-RSA-AES256-CCM:"
100 "DHE-RSA-AES128-CCM:"
101 "DHE-RSA-CHACHA20-POLY1305"};
102
103/*
104 Following ciphers (or categories of ciphers) are not permitted
105 because they are too weak to provide required security.
106
107 New cipher/category can be added at any position.
108
109 Care must be taken to prefix cipher/category with "!"
110*/
111const char blocked_tls12_ciphers[] = {
112 "!aNULL:"
113 "!eNULL:"
114 "!EXPORT:"
115 "!LOW:"
116 "!MD5:"
117 "!DES:"
118 "!3DES:"
119 "!RC2:"
120 "!RC4:"
121 "!PSK:"
122#if (OPENSSL_VERSION_NUMBER >= 0x30500000L)
123 "!kDH"};
124#else
125 "!DH-RSA-AES128-SHA256:"
126 "!DH-RSA-AES256-SHA256:"
127 "!DH-DSS-AES128-SHA256:"
128 "!DH-DSS-AES128-SHA:"
129 "!DH-DSS-AES256-SHA:"
130 "!DH-DSS-AES256-SHA256:"
131 "!DH-RSA-AES128-SHA:"
132 "!DH-RSA-AES256-SHA:"
133 "!DH-DSS-AES128-GCM-SHA256:"
134 "!DH-DSS-AES256-GCM-SHA384:"
135 "!DH-RSA-AES128-GCM-SHA256:"
136 "!DH-RSA-AES256-GCM-SHA384"};
137#endif
138
139/*
140 Following ciphers are added to the list of permissible ciphers
141 while configuring the ciphers on client side.
142
143 This is done to provide backward compatbility.
144*/
146 "ECDHE-ECDSA-AES256-CCM8:"
147 "ECDHE-ECDSA-AES128-CCM8:"
148 "DHE-RSA-AES256-CCM8:"
149 "DHE-RSA-AES128-CCM8:"
150 "ECDHE-ECDSA-AES128-SHA256:"
151 "ECDHE-RSA-AES128-SHA256:"
152 "ECDHE-ECDSA-AES256-SHA384:"
153 "ECDHE-RSA-AES256-SHA384:"
154 "DHE-DSS-AES256-GCM-SHA384:"
155 "DHE-DSS-AES128-GCM-SHA256:"
156 "DHE-DSS-AES128-SHA256:"
157 "DHE-DSS-AES256-SHA256:"
158 "DHE-RSA-AES256-SHA256:"
159 "DHE-RSA-AES128-SHA256:"
160 "DHE-RSA-CAMELLIA256-SHA256:"
161 "DHE-RSA-CAMELLIA128-SHA256:"
162 "ECDHE-RSA-AES128-SHA:"
163 "ECDHE-ECDSA-AES128-SHA:"
164 "ECDHE-RSA-AES256-SHA:"
165 "ECDHE-ECDSA-AES256-SHA:"
166 "DHE-DSS-AES128-SHA:"
167 "DHE-RSA-AES128-SHA:"
168 "DHE-RSA-AES256-SHA:"
169 "DHE-DSS-AES256-SHA:"
170 "DHE-RSA-CAMELLIA256-SHA:"
171 "DHE-RSA-CAMELLIA128-SHA:"
172 "ECDH-ECDSA-AES128-SHA256:"
173 "ECDH-RSA-AES128-SHA256:"
174 "ECDH-RSA-AES256-SHA384:"
175 "ECDH-ECDSA-AES256-SHA384:"
176 "ECDH-ECDSA-AES128-SHA:"
177 "ECDH-ECDSA-AES256-SHA:"
178 "ECDH-RSA-AES128-SHA:"
179 "ECDH-RSA-AES256-SHA:"
180 "AES128-GCM-SHA256:"
181 "AES128-CCM:"
182 "AES128-CCM8:"
183 "AES256-GCM-SHA384:"
184 "AES256-CCM:"
185 "AES256-CCM8:"
186 "AES128-SHA256:"
187 "AES256-SHA256:"
188 "AES128-SHA:"
189 "AES256-SHA:"
190 "CAMELLIA256-SHA:"
191 "CAMELLIA128-SHA:"
192 "ECDH-ECDSA-AES128-GCM-SHA256:"
193 "ECDH-ECDSA-AES256-GCM-SHA384:"
194 "ECDH-RSA-AES128-GCM-SHA256:"
195 "ECDH-RSA-AES256-GCM-SHA384"};
196
197} // namespace
198
199#endif /* TLS_CIPHERS_INCLUDED */
const char blocked_tls12_ciphers[]
Definition: tls_ciphers.h:111
const char default_tls13_ciphers[]
Configuring list of ciphers.
Definition: tls_ciphers.h:71
const char default_tls12_ciphers[]
Definition: tls_ciphers.h:88
const char additional_client_ciphers[]
Definition: tls_ciphers.h:145