1=pod
2
3=head1 NAME
4
5SSL_CTX_set_max_cert_list, SSL_CTX_get_max_cert_list, SSL_set_max_cert_list, SSL_get_max_cert_list - manipulate allowed size for the peer's certificate chain
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 long SSL_CTX_set_max_cert_list(SSL_CTX *ctx, long size);
12 long SSL_CTX_get_max_cert_list(SSL_CTX *ctx);
13
14 long SSL_set_max_cert_list(SSL *ssl, long size);
15 long SSL_get_max_cert_list(SSL *ctx);
16
17=head1 DESCRIPTION
18
19SSL_CTX_set_max_cert_list() sets the maximum size allowed for the peer's
20certificate chain for all SSL objects created from B<ctx> to be <size> bytes.
21The SSL objects inherit the setting valid for B<ctx> at the time
22L<SSL_new(3)> is being called.
23
24SSL_CTX_get_max_cert_list() returns the currently set maximum size for B<ctx>.
25
26SSL_set_max_cert_list() sets the maximum size allowed for the peer's
27certificate chain for B<ssl> to be <size> bytes. This setting stays valid
28until a new value is set.
29
30SSL_get_max_cert_list() returns the currently set maximum size for B<ssl>.
31
32=head1 NOTES
33
34During the handshake process, the peer may send a certificate chain.
35The TLS/SSL standard does not give any maximum size of the certificate chain.
36The OpenSSL library handles incoming data by a dynamically allocated buffer.
37In order to prevent this buffer from growing without bounds due to data
38received from a faulty or malicious peer, a maximum size for the certificate
39chain is set.
40
41The default value for the maximum certificate chain size is 100kB (30kB
42on the 16-bit DOS platform). This should be sufficient for usual certificate
43chains (OpenSSL's default maximum chain length is 10, see
44L<SSL_CTX_set_verify(3)>, and certificates
45without special extensions have a typical size of 1-2kB).
46
47For special applications it can be necessary to extend the maximum certificate
48chain size allowed to be sent by the peer, see e.g. the work on
49"Internet X.509 Public Key Infrastructure Proxy Certificate Profile"
50and "TLS Delegation Protocol" at http://www.ietf.org/ and
51http://www.globus.org/ .
52
53Under normal conditions it should never be necessary to set a value smaller
54than the default, as the buffer is handled dynamically and only uses the
55memory actually required by the data sent by the peer.
56
57If the maximum certificate chain size allowed is exceeded, the handshake will
58fail with a SSL_R_EXCESSIVE_MESSAGE_SIZE error.
59
60=head1 RETURN VALUES
61
62SSL_CTX_set_max_cert_list() and SSL_set_max_cert_list() return the previously
63set value.
64
65SSL_CTX_get_max_cert_list() and SSL_get_max_cert_list() return the currently
66set value.
67
68=head1 SEE ALSO
69
70L<ssl(7)>, L<SSL_new(3)>,
71L<SSL_CTX_set_verify(3)>
72
73=head1 COPYRIGHT
74
75Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
76
77Licensed under the OpenSSL license (the "License").  You may not use
78this file except in compliance with the License.  You can obtain a copy
79in the file LICENSE in the source distribution or at
80L<https://www.openssl.org/source/license.html>.
81
82=cut
83