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