1=pod
2
3=head1 NAME
4
5SSL_CTX_add_extra_chain_cert, SSL_CTX_clear_extra_chain_certs - add or clear
6extra chain certificates
7
8=head1 SYNOPSIS
9
10 #include <openssl/ssl.h>
11
12 long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509);
13 long SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx);
14
15=head1 DESCRIPTION
16
17SSL_CTX_add_extra_chain_cert() adds the certificate B<x509> to the extra chain
18certificates associated with B<ctx>. Several certificates can be added one
19after another.
20
21SSL_CTX_clear_extra_chain_certs() clears all extra chain certificates
22associated with B<ctx>.
23
24These functions are implemented as macros.
25
26=head1 NOTES
27
28When sending a certificate chain, extra chain certificates are sent in order
29following the end entity certificate.
30
31If no chain is specified, the library will try to complete the chain from the
32available CA certificates in the trusted CA storage, see
33L<SSL_CTX_load_verify_locations(3)>.
34
35The B<x509> certificate provided to SSL_CTX_add_extra_chain_cert() will be
36freed by the library when the B<SSL_CTX> is destroyed. An application
37B<should not> free the B<x509> object.
38
39=head1 RESTRICTIONS
40
41Only one set of extra chain certificates can be specified per SSL_CTX
42structure. Different chains for different certificates (for example if both
43RSA and DSA certificates are specified by the same server) or different SSL
44structures with the same parent SSL_CTX cannot be specified using this
45function. For more flexibility functions such as SSL_add1_chain_cert() should
46be used instead.
47
48=head1 RETURN VALUES
49
50SSL_CTX_add_extra_chain_cert() and SSL_CTX_clear_extra_chain_certs() return
511 on success and 0 for failure. Check out the error stack to find out the
52reason for failure.
53
54=head1 SEE ALSO
55
56L<ssl(7)>,
57L<SSL_CTX_use_certificate(3)>,
58L<SSL_CTX_set_client_cert_cb(3)>,
59L<SSL_CTX_load_verify_locations(3)>
60L<SSL_CTX_set0_chain(3)>
61L<SSL_CTX_set1_chain(3)>
62L<SSL_CTX_add0_chain_cert(3)>
63L<SSL_CTX_add1_chain_cert(3)>
64L<SSL_set0_chain(3)>
65L<SSL_set1_chain(3)>
66L<SSL_add0_chain_cert(3)>
67L<SSL_add1_chain_cert(3)>
68L<SSL_CTX_build_cert_chain(3)>
69L<SSL_build_cert_chain(3)>
70
71=head1 COPYRIGHT
72
73Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
74
75Licensed under the OpenSSL license (the "License").  You may not use
76this file except in compliance with the License.  You can obtain a copy
77in the file LICENSE in the source distribution or at
78L<https://www.openssl.org/source/license.html>.
79
80=cut
81