
#use wml::openssl-macros area=docs page=SSL_CTX_set_max_cert_list

<title>Documents, SSL_CTX_set_max_cert_list(3)</title>

<h1>SSL_CTX_set_max_cert_list(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_CTX_set_max_cert_list, SSL_CTX_get_max_cert_list,
SSL_set_max_cert_list, SSL_get_max_cert_list, - manipulate allowed for the
peer's certificate chain

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> long SSL_CTX_set_max_cert_list(SSL_CTX *ctx, long size);
 long SSL_CTX_get_max_cert_list(SSL_CTX *ctx);
</PRE>
<PRE> long SSL_set_max_cert_list(SSL *ssl, long size);
 long SSL_get_max_cert_list(SSL *ctx);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_CTX_set_max_cert_list()</CODE> sets the maximum size allowed for
the peer's certificate chain for all SSL objects created from <STRONG>ctx</STRONG> to be &lt;size&gt; bytes. The SSL objects inherit the setting valid for <STRONG>ctx</STRONG> at the time
<A HREF="../ssl/SSL_new.html#">SSL_new(3)</A> is being called.

</P>
<P>
<CODE>SSL_CTX_get_max_cert_list()</CODE> returns the currently set maximum
size for <STRONG>ctx</STRONG>.

</P>
<P>
<CODE>SSL_set_max_cert_list()</CODE> sets the maximum size allowed for the
peer's certificate chain for <STRONG>ssl</STRONG> to be &lt;size&gt; bytes. This setting stays valid until a new value is
set.

</P>
<P>
<CODE>SSL_get_max_cert_list()</CODE> returns the currently set maximum size
for <STRONG>ssl</STRONG>.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
During the handshake process, the peer may send a certificate chain. The
TLS/SSL standard does not give any maximum size of the certificate chain.
The OpenSSL library handles incoming data by a dynamically allocated
buffer. In order to prevent this buffer from growing without bounds due to
data received from a faulty or malicious peer, a maximum size for the
certificate chain is set.

</P>
<P>
The default value for the maximum certificate chain size is 100kB (30kB on
the 16bit DOS platform). This should be sufficient for usual certificate
chains (OpenSSL's default maximum chain length is 10, see
<A HREF="../ssl/SSL_CTX_set_verify.html#">SSL_CTX_set_verify(3)</A>, and certificates without special extensions have a typical size of
1-2kB).

</P>
<P>
For special applications it can be necessary to extend the maximum
certificate chain size allowed to be sent by the peer, see e.g. the work on
``Internet X.509 Public Key Infrastructure Proxy Certificate Profile'' and
``TLS Delegation Protocol'' at <A
HREF="http://www.ietf.org/">http://www.ietf.org/</A> and <A
HREF="http://www.globus.org/">http://www.globus.org/</A> .

</P>
<P>
Under normal conditions it should never be necessary to set a value smaller
than the default, as the buffer is handled dynamically and only uses the
memory actually required by the data sent by the peer.

</P>
<P>
If the maximum certificate chain size allowed is exceeded, the handshake
will fail with a SSL_R_EXCESSIVE_MESSAGE_SIZE error.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>SSL_CTX_set_max_cert_list()</CODE> and
<CODE>SSL_set_max_cert_list()</CODE> return the previously set value.

</P>
<P>
<CODE>SSL_CTX_get_max_cert_list()</CODE> and
<CODE>SSL_get_max_cert_list()</CODE> return the currently set value.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../ssl/ssl.html#">ssl(3)</A>, <A HREF="../ssl/SSL_new.html#">SSL_new(3)</A>,
<A HREF="../ssl/SSL_CTX_set_verify.html#">SSL_CTX_set_verify(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
SSL*_set/get_max_cert_list() have been introduced in OpenSSL 0.9.7.

</P>
:}

