Blame doc/man3/SSL_CTX_set_cipher_list.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
SSL_CTX_set_cipher_list,
Packit c4476c
SSL_set_cipher_list,
Packit c4476c
SSL_CTX_set_ciphersuites,
Packit c4476c
SSL_set_ciphersuites
Packit c4476c
- choose list of available SSL_CIPHERs
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/ssl.h>
Packit c4476c
Packit c4476c
 int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str);
Packit c4476c
 int SSL_set_cipher_list(SSL *ssl, const char *str);
Packit c4476c
Packit c4476c
 int SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *str);
Packit c4476c
 int SSL_set_ciphersuites(SSL *s, const char *str);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
SSL_CTX_set_cipher_list() sets the list of available ciphers (TLSv1.2 and below)
Packit c4476c
for B<ctx> using the control string B<str>. The format of the string is described
Packit c4476c
in L<ciphers(1)>. The list of ciphers is inherited by all
Packit c4476c
B<ssl> objects created from B<ctx>. This function does not impact TLSv1.3
Packit c4476c
ciphersuites. Use SSL_CTX_set_ciphersuites() to configure those.
Packit c4476c
Packit c4476c
SSL_set_cipher_list() sets the list of ciphers (TLSv1.2 and below) only for
Packit c4476c
B<ssl>.
Packit c4476c
Packit c4476c
SSL_CTX_set_ciphersuites() is used to configure the available TLSv1.3
Packit c4476c
ciphersuites for B<ctx>. This is a simple colon (":") separated list of TLSv1.3
Packit c4476c
ciphersuite names in order of preference. Valid TLSv1.3 ciphersuite names are:
Packit c4476c
Packit c4476c
=over 4
Packit c4476c
Packit c4476c
=item TLS_AES_128_GCM_SHA256
Packit c4476c
Packit c4476c
=item TLS_AES_256_GCM_SHA384
Packit c4476c
Packit c4476c
=item TLS_CHACHA20_POLY1305_SHA256
Packit c4476c
Packit c4476c
=item TLS_AES_128_CCM_SHA256
Packit c4476c
Packit c4476c
=item TLS_AES_128_CCM_8_SHA256
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
An empty list is permissible. The default value for the this setting is:
Packit c4476c
Packit c4476c
"TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256"
Packit c4476c
Packit c4476c
SSL_set_ciphersuites() is the same as SSL_CTX_set_ciphersuites() except it
Packit c4476c
configures the ciphersuites for B<ssl>.
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
The control string B<str> for SSL_CTX_set_cipher_list() and
Packit c4476c
SSL_set_cipher_list() should be universally usable and not depend
Packit c4476c
on details of the library configuration (ciphers compiled in). Thus no
Packit c4476c
syntax checking takes place. Items that are not recognized, because the
Packit c4476c
corresponding ciphers are not compiled in or because they are mistyped,
Packit c4476c
are simply ignored. Failure is only flagged if no ciphers could be collected
Packit c4476c
at all.
Packit c4476c
Packit c4476c
It should be noted, that inclusion of a cipher to be used into the list is
Packit c4476c
a necessary condition. On the client side, the inclusion into the list is
Packit c4476c
also sufficient unless the security level excludes it. On the server side,
Packit c4476c
additional restrictions apply. All ciphers have additional requirements.
Packit c4476c
ADH ciphers don't need a certificate, but DH-parameters must have been set.
Packit c4476c
All other ciphers need a corresponding certificate and key.
Packit c4476c
Packit c4476c
A RSA cipher can only be chosen, when a RSA certificate is available.
Packit c4476c
RSA ciphers using DHE need a certificate and key and additional DH-parameters
Packit c4476c
(see L<SSL_CTX_set_tmp_dh_callback(3)>).
Packit c4476c
Packit c4476c
A DSA cipher can only be chosen, when a DSA certificate is available.
Packit c4476c
DSA ciphers always use DH key exchange and therefore need DH-parameters
Packit c4476c
(see L<SSL_CTX_set_tmp_dh_callback(3)>).
Packit c4476c
Packit c4476c
When these conditions are not met for any cipher in the list (e.g. a
Packit c4476c
client only supports export RSA ciphers with an asymmetric key length
Packit c4476c
of 512 bits and the server is not configured to use temporary RSA
Packit c4476c
keys), the "no shared cipher" (SSL_R_NO_SHARED_CIPHER) error is generated
Packit c4476c
and the handshake will fail.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
SSL_CTX_set_cipher_list() and SSL_set_cipher_list() return 1 if any cipher
Packit c4476c
could be selected and 0 on complete failure.
Packit c4476c
Packit c4476c
SSL_CTX_set_ciphersuites() and SSL_set_ciphersuites() return 1 if the requested
Packit c4476c
ciphersuite list was configured, and 0 otherwise.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ssl(7)>, L<SSL_get_ciphers(3)>,
Packit c4476c
L<SSL_CTX_use_certificate(3)>,
Packit c4476c
L<SSL_CTX_set_tmp_dh_callback(3)>,
Packit c4476c
L<ciphers(1)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut