Blame doc/man3/SSL_CTX_set_max_cert_list.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
SSL_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
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/ssl.h>
Packit c4476c
Packit c4476c
 long SSL_CTX_set_max_cert_list(SSL_CTX *ctx, long size);
Packit c4476c
 long SSL_CTX_get_max_cert_list(SSL_CTX *ctx);
Packit c4476c
Packit c4476c
 long SSL_set_max_cert_list(SSL *ssl, long size);
Packit c4476c
 long SSL_get_max_cert_list(SSL *ctx);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
SSL_CTX_set_max_cert_list() sets the maximum size allowed for the peer's
Packit c4476c
certificate chain for all SSL objects created from B<ctx> to be <size> bytes.
Packit c4476c
The SSL objects inherit the setting valid for B<ctx> at the time
Packit c4476c
L<SSL_new(3)> is being called.
Packit c4476c
Packit c4476c
SSL_CTX_get_max_cert_list() returns the currently set maximum size for B<ctx>.
Packit c4476c
Packit c4476c
SSL_set_max_cert_list() sets the maximum size allowed for the peer's
Packit c4476c
certificate chain for B<ssl> to be <size> bytes. This setting stays valid
Packit c4476c
until a new value is set.
Packit c4476c
Packit c4476c
SSL_get_max_cert_list() returns the currently set maximum size for B<ssl>.
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
During the handshake process, the peer may send a certificate chain.
Packit c4476c
The TLS/SSL standard does not give any maximum size of the certificate chain.
Packit c4476c
The OpenSSL library handles incoming data by a dynamically allocated buffer.
Packit c4476c
In order to prevent this buffer from growing without bounds due to data
Packit c4476c
received from a faulty or malicious peer, a maximum size for the certificate
Packit c4476c
chain is set.
Packit c4476c
Packit c4476c
The default value for the maximum certificate chain size is 100kB (30kB
Packit c4476c
on the 16bit DOS platform). This should be sufficient for usual certificate
Packit c4476c
chains (OpenSSL's default maximum chain length is 10, see
Packit c4476c
L<SSL_CTX_set_verify(3)>, and certificates
Packit c4476c
without special extensions have a typical size of 1-2kB).
Packit c4476c
Packit c4476c
For special applications it can be necessary to extend the maximum certificate
Packit c4476c
chain size allowed to be sent by the peer, see e.g. the work on
Packit c4476c
"Internet X.509 Public Key Infrastructure Proxy Certificate Profile"
Packit c4476c
and "TLS Delegation Protocol" at http://www.ietf.org/ and
Packit c4476c
http://www.globus.org/ .
Packit c4476c
Packit c4476c
Under normal conditions it should never be necessary to set a value smaller
Packit c4476c
than the default, as the buffer is handled dynamically and only uses the
Packit c4476c
memory actually required by the data sent by the peer.
Packit c4476c
Packit c4476c
If the maximum certificate chain size allowed is exceeded, the handshake will
Packit c4476c
fail with a SSL_R_EXCESSIVE_MESSAGE_SIZE error.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
SSL_CTX_set_max_cert_list() and SSL_set_max_cert_list() return the previously
Packit c4476c
set value.
Packit c4476c
Packit c4476c
SSL_CTX_get_max_cert_list() and SSL_get_max_cert_list() return the currently
Packit c4476c
set value.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ssl(7)>, L<SSL_new(3)>,
Packit c4476c
L<SSL_CTX_set_verify(3)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2001-2016 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