]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/SSL_CTX_set0_CA_list.pod
Update copyright year
[thirdparty/openssl.git] / doc / man3 / SSL_CTX_set0_CA_list.pod
CommitLineData
5a185729
DSH
1=pod
2
3=head1 NAME
4
5SSL_set0_CA_list, SSL_CTX_set0_CA_list, SSL_get0_CA_list,
64a48fc7 6SSL_CTX_get0_CA_list, SSL_add1_to_CA_list, SSL_CTX_add1_to_CA_list,
5a185729
DSH
7SSL_get0_peer_CA_list - get or set CA list
8
9=head1 SYNOPSIS
10
11 #include <openssl/ssl.h>
12
13 void SSL_CTX_set0_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list);
14 void SSL_set0_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list);
15 const STACK_OF(X509_NAME) *SSL_CTX_get0_CA_list(const SSL_CTX *ctx);
16 const STACK_OF(X509_NAME) *SSL_get0_CA_list(const SSL *s);
64a48fc7
RL
17 int SSL_CTX_add1_to_CA_list(SSL_CTX *ctx, const X509 *x);
18 int SSL_add1_to_CA_list(SSL *ssl, const X509 *x);
5a185729
DSH
19
20 const STACK_OF(X509_NAME) *SSL_get0_peer_CA_list(const SSL *s);
21
22=head1 DESCRIPTION
23
24SSL_CTX_set0_CA_list() sets the list of CAs to be sent to the peer to
25B<name_list>. Ownership of B<name_list> is transferred to B<ctx> and
26it should not be freed by the caller.
27
28SSL_set0_CA_list() sets the list of CAs to be sent to the peer to B<name_list>
29overriding any list set in the parent B<SSL_CTX> of B<s>. Ownership of
30B<name_list> is transferred to B<s> and it should not be freed by the caller.
31
32SSL_CTX_get0_CA_list() retrieves any previously set list of CAs set for
33B<ctx>.
34
35SSL_CTX_get0_CA_list() retrieves any previously set list of CAs set for
36B<s> or if none are set the list from the parent B<SSL_CTX> is retrieved.
37
64a48fc7 38SSL_CTX_add1_to_CA_list() appends the CA subject name extracted from B<x> to the
5a185729
DSH
39list of CAs sent to peer for B<ctx>.
40
64a48fc7 41SSL_add1_to_CA_list() appends the CA subject name extracted from B<x> to the
5a185729
DSH
42list of CAs sent to the peer for B<s>, overriding the setting in the parent
43B<SSL_CTX>.
44
45SSL_get0_peer_CA_list() retrieves the list of CA names (if any) the peer
46has sent.
47
48=head1 NOTES
49
50These functions are generalised versions of the client authentication
51CA list functions such as L<SSL_CTX_set_client_CA_list(3)>.
52
53For TLS versions before 1.3 the list of CA names is only sent from the server
54to client when requesting a client certificate. So any list of CA names set
55is never sent from client to server and the list of CA names retrieved by
56SSL_get0_peer_CA_list() is always B<NULL>.
57
58For TLS 1.3 the list of CA names is sent using the B<certificate_authorities>
59extension and will be sent by a client (in the ClientHello message) or by
60a server (when requesting a certificate).
61
62=head1 RETURN VALUES
63
64SSL_CTX_set0_CA_list() and SSL_set0_CA_list() do not return a value.
65
66SSL_CTX_get0_CA_list() and SSL_get0_CA_list() return a stack of CA names
67or B<NULL> is no CA names are set.
68
64a48fc7 69SSL_CTX_add1_to_CA_list() and SSL_add1_to_CA_list() return 1 for success and 0
5a185729
DSH
70for failure.
71
72SSL_get0_peer_CA_list() returns a stack of CA names sent by the peer or
73B<NULL> or an empty stack if no list was sent.
74
5a185729
DSH
75=head1 SEE ALSO
76
77L<ssl(7)>,
78L<SSL_CTX_set_client_CA_list(3)>,
79L<SSL_get_client_CA_list(3)>,
80L<SSL_load_client_CA_file(3)>,
81L<SSL_CTX_load_verify_locations(3)>
82
83=head1 COPYRIGHT
84
1212818e 85Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
5a185729
DSH
86
87Licensed under the OpenSSL license (the "License"). You may not use
88this file except in compliance with the License. You can obtain a copy
89in the file LICENSE in the source distribution or at
90L<https://www.openssl.org/source/license.html>.
91
92=cut