Debian Codegraph @

upstream/debian-unstable/man3/SSL_CTX_set_cipher_list.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "SSL_CTX_SET_CIPHER_LIST 3SSL"
58 .TH SSL_CTX_SET_CIPHER_LIST 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 SSL_CTX_set_cipher_list,
65 SSL_set_cipher_list,
66 SSL_CTX_set_ciphersuites,
67 SSL_set_ciphersuites,
68 OSSL_default_cipher_list,
69 OSSL_default_ciphersuites
70 \&\- choose list of available SSL_CIPHERs
71 .SH SYNOPSIS
72 .IX Header "SYNOPSIS"
73 .Vb 1
74 \& #include <openssl/ssl.h>
75 \&
76 \& int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str);
77 \& int SSL_set_cipher_list(SSL *ssl, const char *str);
78 \&
79 \& int SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *str);
80 \& int SSL_set_ciphersuites(SSL *s, const char *str);
81 \&
82 \& const char *OSSL_default_cipher_list(void);
83 \& const char *OSSL_default_ciphersuites(void);
84 .Ve
85 .SH DESCRIPTION
86 .IX Header "DESCRIPTION"
87 \&\fBSSL_CTX_set_cipher_list()\fR sets the list of available ciphers (TLSv1.2 and below)
88 for \fBctx\fR using the control string \fBstr\fR. The format of the string is described
89 in \fBopenssl\-ciphers\fR\|(1). The list of ciphers is inherited by all
90 \&\fBssl\fR objects created from \fBctx\fR. This function does not impact TLSv1.3
91 ciphersuites. Use \fBSSL_CTX_set_ciphersuites()\fR to configure those. \fBctx\fR \fBMUST NOT\fR be NULL.
92 .PP
93 \&\fBSSL_set_cipher_list()\fR sets the list of ciphers (TLSv1.2 and below) only for
94 \&\fBssl\fR.
95 .PP
96 \&\fBSSL_CTX_set_ciphersuites()\fR is used to configure the available TLSv1.3
97 ciphersuites for \fBctx\fR. This is a simple colon (":") separated list of TLSv1.3
98 ciphersuite names in order of preference. Valid TLSv1.3 ciphersuite names are:
99 .IP TLS_AES_128_GCM_SHA256 4
100 .IX Item "TLS_AES_128_GCM_SHA256"
101 .PD 0
102 .IP TLS_AES_256_GCM_SHA384 4
103 .IX Item "TLS_AES_256_GCM_SHA384"
104 .IP TLS_CHACHA20_POLY1305_SHA256 4
105 .IX Item "TLS_CHACHA20_POLY1305_SHA256"
106 .IP TLS_AES_128_CCM_SHA256 4
107 .IX Item "TLS_AES_128_CCM_SHA256"
108 .IP TLS_AES_128_CCM_8_SHA256 4
109 .IX Item "TLS_AES_128_CCM_8_SHA256"
110 .IP "TLS_SHA384_SHA384 \- integrity-only" 4
111 .IX Item "TLS_SHA384_SHA384 - integrity-only"
112 .IP "TLS_SHA256_SHA256 \- integrity-only" 4
113 .IX Item "TLS_SHA256_SHA256 - integrity-only"
114 .PD
115 .PP
116 An empty list is permissible. The default value for this setting is:
117 .PP
118 "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256"
119 .PP
120 \&\fBSSL_set_ciphersuites()\fR is the same as \fBSSL_CTX_set_ciphersuites()\fR except it
121 configures the ciphersuites for \fBssl\fR.
122 .PP
123 \&\fBOSSL_default_cipher_list()\fR returns the default cipher string for TLSv1.2
124 (and earlier) ciphers. \fBOSSL_default_ciphersuites()\fR returns the default
125 cipher string for TLSv1.3 ciphersuites.
126 .SH NOTES
127 .IX Header "NOTES"
128 The control string \fBstr\fR for \fBSSL_CTX_set_cipher_list()\fR, \fBSSL_set_cipher_list()\fR,
129 \&\fBSSL_CTX_set_ciphersuites()\fR and \fBSSL_set_ciphersuites()\fR should be universally
130 usable and not depend on details of the library configuration (ciphers compiled
131 in). Thus no syntax checking takes place. Items that are not recognized, because
132 the corresponding ciphers are not compiled in or because they are mistyped,
133 are simply ignored. Failure is only flagged if no ciphers could be collected
134 at all.
135 .PP
136 It should be noted, that inclusion of a cipher to be used into the list is
137 a necessary condition. On the client side, the inclusion into the list is
138 also sufficient unless the security level excludes it. On the server side,
139 additional restrictions apply. All ciphers have additional requirements.
140 ADH ciphers don't need a certificate, but DH-parameters must have been set.
141 All other ciphers need a corresponding certificate and key.
142 .PP
143 An RSA cipher can only be chosen, when an RSA certificate is available.
144 RSA ciphers using DHE need a certificate and key and additional DH-parameters
145 (see \fBSSL_CTX_set_tmp_dh_callback\fR\|(3)).
146 .PP
147 A DSA cipher can only be chosen, when a DSA certificate is available.
148 DSA ciphers always use DH key exchange and therefore need DH-parameters
149 (see \fBSSL_CTX_set_tmp_dh_callback\fR\|(3)).
150 .PP
151 When these conditions are not met for any cipher in the list (e.g. a
152 client only supports export RSA ciphers with an asymmetric key length
153 of 512 bits and the server is not configured to use temporary RSA
154 keys), the "no shared cipher" (SSL_R_NO_SHARED_CIPHER) error is generated
155 and the handshake will fail.
156 .PP
157 \&\fBOSSL_default_cipher_list()\fR and \fBOSSL_default_ciphersuites()\fR replace
158 SSL_DEFAULT_CIPHER_LIST and TLS_DEFAULT_CIPHERSUITES, respectively. The
159 cipher list defines are deprecated as of 3.0.
160 .SH "RETURN VALUES"
161 .IX Header "RETURN VALUES"
162 \&\fBSSL_CTX_set_cipher_list()\fR and \fBSSL_set_cipher_list()\fR return 1 if any cipher
163 could be selected and 0 on complete failure.
164 .PP
165 \&\fBSSL_CTX_set_ciphersuites()\fR and \fBSSL_set_ciphersuites()\fR return 1 if the requested
166 ciphersuite list was configured, and 0 otherwise.
167 .SH "SEE ALSO"
168 .IX Header "SEE ALSO"
169 \&\fBssl\fR\|(7), \fBSSL_get_ciphers\fR\|(3),
170 \&\fBSSL_CTX_use_certificate\fR\|(3),
171 \&\fBSSL_CTX_set_tmp_dh_callback\fR\|(3),
172 \&\fBopenssl\-ciphers\fR\|(1)
173 .SH HISTORY
174 .IX Header "HISTORY"
175 \&\fBOSSL_default_cipher_list()\fR and \fBOSSL_default_ciphersites()\fR are new in 3.0.
176 .SH COPYRIGHT
177 .IX Header "COPYRIGHT"
178 Copyright 2000\-2024 The OpenSSL Project Authors. All Rights Reserved.
179 .PP
180 Licensed under the Apache License 2.0 (the "License"). You may not use
181 this file except in compliance with the License. You can obtain a copy
182 in the file LICENSE in the source distribution or at
183 <https://www.openssl.org/source/license.html>.