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

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

<h1>SSL_CTX_set_timeout(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>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_CTX_set_timeout, SSL_CTX_get_timeout - manipulate timeout values for
session caching

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> long SSL_CTX_set_timeout(SSL_CTX *ctx, long t);
 long SSL_CTX_get_timeout(SSL_CTX *ctx);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_CTX_set_timeout()</CODE> sets the timeout for newly created
sessions for
<STRONG>ctx</STRONG> to <STRONG>t</STRONG>. The timeout value <STRONG>t</STRONG> must be given in seconds.

</P>
<P>
<CODE>SSL_CTX_get_timeout()</CODE> returns the currently set timeout value
for <STRONG>ctx</STRONG>.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
Whenever a new session is created, it is assigned a maximum lifetime. This
lifetime is specified by storing the creation time of the session and the
timeout value valid at this time. If the actual time is later than creation
time plus timeout, the session is not reused.

</P>
<P>
Due to this realization, all sessions behave according to the timeout value
valid at the time of the session negotiation. Changes of the timeout value
do not affect already established sessions.

</P>
<P>
The expiration time of a single session can be modified using the
<A HREF="../ssl/SSL_SESSION_get_time.html#">SSL_SESSION_get_time(3)</A> family of functions.

</P>
<P>
Expired sessions are removed from the internal session cache, whenever
<A HREF="../ssl/SSL_CTX_flush_sessions.html#">SSL_CTX_flush_sessions(3)</A> is called, either directly by the application or automatically (see
<A HREF="../ssl/SSL_CTX_set_session_cache_mode.html#">SSL_CTX_set_session_cache_mode(3)</A>)

</P>
<P>
The default value for session timeout is decided on a per protocol basis,
see <A HREF="../ssl/SSL_get_default_timeout.html#">SSL_get_default_timeout(3)</A>. All currently supported protocols have the same default timeout value of
300 seconds.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>SSL_CTX_set_timeout()</CODE> returns the previously set timeout
value.

</P>
<P>
<CODE>SSL_CTX_get_timeout()</CODE> returns the currently set timeout 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_CTX_set_session_cache_mode.html#">SSL_CTX_set_session_cache_mode(3)</A>,
<A HREF="../ssl/SSL_SESSION_get_time.html#">SSL_SESSION_get_time(3)</A>,
<A HREF="../ssl/SSL_CTX_flush_sessions.html#">SSL_CTX_flush_sessions(3)</A>,
<A HREF="../ssl/SSL_get_default_timeout.html#">SSL_get_default_timeout(3)</A>



</P>
:}

