MySQL 9.1.0
Source Code Documentation
tls_ciphers.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018, 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 "!kDH"};
121
122/*
123 Following ciphers are added to the list of permissible ciphers
124 while configuring the ciphers on client side.
125
126 This is done to provide backward compatbility.
127*/
129 "ECDHE-ECDSA-AES256-CCM8:"
130 "ECDHE-ECDSA-AES128-CCM8:"
131 "DHE-RSA-AES256-CCM8:"
132 "DHE-RSA-AES128-CCM8:"
133 "ECDHE-ECDSA-AES128-SHA256:"
134 "ECDHE-RSA-AES128-SHA256:"
135 "ECDHE-ECDSA-AES256-SHA384:"
136 "ECDHE-RSA-AES256-SHA384:"
137 "DHE-DSS-AES256-GCM-SHA384:"
138 "DHE-DSS-AES128-GCM-SHA256:"
139 "DHE-DSS-AES128-SHA256:"
140 "DHE-DSS-AES256-SHA256:"
141 "DHE-RSA-AES256-SHA256:"
142 "DHE-RSA-AES128-SHA256:"
143 "DHE-RSA-CAMELLIA256-SHA256:"
144 "DHE-RSA-CAMELLIA128-SHA256:"
145 "ECDHE-RSA-AES128-SHA:"
146 "ECDHE-ECDSA-AES128-SHA:"
147 "ECDHE-RSA-AES256-SHA:"
148 "ECDHE-ECDSA-AES256-SHA:"
149 "DHE-DSS-AES128-SHA:"
150 "DHE-RSA-AES128-SHA:"
151 "DHE-RSA-AES256-SHA:"
152 "DHE-DSS-AES256-SHA:"
153 "DHE-RSA-CAMELLIA256-SHA:"
154 "DHE-RSA-CAMELLIA128-SHA:"
155 "ECDH-ECDSA-AES128-SHA256:"
156 "ECDH-RSA-AES128-SHA256:"
157 "ECDH-RSA-AES256-SHA384:"
158 "ECDH-ECDSA-AES256-SHA384:"
159 "ECDH-ECDSA-AES128-SHA:"
160 "ECDH-ECDSA-AES256-SHA:"
161 "ECDH-RSA-AES128-SHA:"
162 "ECDH-RSA-AES256-SHA:"
163 "AES128-GCM-SHA256:"
164 "AES128-CCM:"
165 "AES128-CCM8:"
166 "AES256-GCM-SHA384:"
167 "AES256-CCM:"
168 "AES256-CCM8:"
169 "AES128-SHA256:"
170 "AES256-SHA256:"
171 "AES128-SHA:"
172 "AES256-SHA:"
173 "CAMELLIA256-SHA:"
174 "CAMELLIA128-SHA:"
175 "ECDH-ECDSA-AES128-GCM-SHA256:"
176 "ECDH-ECDSA-AES256-GCM-SHA384:"
177 "ECDH-RSA-AES128-GCM-SHA256:"
178 "ECDH-RSA-AES256-GCM-SHA384"};
179
180} // namespace
181
182#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:128