1 .\" $OpenBSD: SSL_CTX_set_max_cert_list.3,v 1.4 2018/03/22 21:09:18 schwarze Exp $
2 .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
4 .\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5 .\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in
16 .\" the documentation and/or other materials provided with the
19 .\" 3. All advertising materials mentioning features or use of this
20 .\" software must display the following acknowledgment:
21 .\" "This product includes software developed by the OpenSSL Project
22 .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25 .\" endorse or promote products derived from this software without
26 .\" prior written permission. For written permission, please contact
27 .\" openssl-core@openssl.org.
29 .\" 5. Products derived from this software may not be called "OpenSSL"
30 .\" nor may "OpenSSL" appear in their names without prior written
31 .\" permission of the OpenSSL Project.
33 .\" 6. Redistributions of any form whatsoever must retain the following
35 .\" "This product includes software developed by the OpenSSL Project
36 .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
51 .Dd $Mdocdate: March 22 2018 $
52 .Dt SSL_CTX_SET_MAX_CERT_LIST 3
55 .Nm SSL_CTX_set_max_cert_list ,
56 .Nm SSL_CTX_get_max_cert_list ,
57 .Nm SSL_set_max_cert_list ,
58 .Nm SSL_get_max_cert_list
59 .Nd manipulate allowed size for the peer's certificate chain
63 .Fn SSL_CTX_set_max_cert_list "SSL_CTX *ctx" "long size"
65 .Fn SSL_CTX_get_max_cert_list "SSL_CTX *ctx"
67 .Fn SSL_set_max_cert_list "SSL *ssl" "long size"
69 .Fn SSL_get_max_cert_list "SSL *ctx"
71 .Fn SSL_CTX_set_max_cert_list
72 sets the maximum size allowed for the peer's certificate chain for all
81 objects inherit the setting valid for
87 .Fn SSL_CTX_get_max_cert_list
88 returns the currently set maximum size for
91 .Fn SSL_set_max_cert_list
92 sets the maximum size allowed for the peer's certificate chain for
97 This setting stays valid until a new value is set.
99 .Fn SSL_get_max_cert_list
100 returns the currently set maximum size for
103 During the handshake process, the peer may send a certificate chain.
104 The TLS/SSL standard does not give any maximum size of the certificate chain.
105 The OpenSSL library handles incoming data by a dynamically allocated buffer.
106 In order to prevent this buffer from growing without bound due to data
107 received from a faulty or malicious peer, a maximum size for the certificate
110 The default value for the maximum certificate chain size is 100kB (30kB
111 on the 16bit DOS platform).
112 This should be sufficient for usual certificate chains
113 (OpenSSL's default maximum chain length is 10, see
114 .Xr SSL_CTX_set_verify 3 ,
115 and certificates without special extensions have a typical size of 1-2kB).
117 For special applications it can be necessary to extend the maximum certificate
118 chain size allowed to be sent by the peer.
119 See for example the work on
120 .%T "Internet X.509 Public Key Infrastructure Proxy Certificate Profile"
122 .%T "TLS Delegation Protocol"
124 .Lk https://www.ietf.org/
126 .Lk http://www.globus.org/ .
128 Under normal conditions it should never be necessary to set a value smaller
129 than the default, as the buffer is handled dynamically and only uses the
130 memory actually required by the data sent by the peer.
132 If the maximum certificate chain size allowed is exceeded, the handshake will
134 .Dv SSL_R_EXCESSIVE_MESSAGE_SIZE
137 .Fn SSL_CTX_set_max_cert_list
139 .Fn SSL_set_max_cert_list
140 return the previously set value.
142 .Fn SSL_CTX_get_max_cert_list
144 .Fn SSL_get_max_cert_list
145 return the currently set value.
148 .Xr SSL_CTX_set_verify 3 ,
151 These functions first appeared in OpenSSL 0.9.7
152 and have been available since