172613Skris=pod
272613Skris
372613Skris=head1 NAME
472613Skris
572613SkrisSSL_CTX_set_timeout, SSL_CTX_get_timeout - manipulate timeout values for session caching
672613Skris
772613Skris=head1 SYNOPSIS
872613Skris
972613Skris #include <openssl/ssl.h>
1072613Skris
1172613Skris long SSL_CTX_set_timeout(SSL_CTX *ctx, long t);
1272613Skris long SSL_CTX_get_timeout(SSL_CTX *ctx);
1372613Skris
1472613Skris=head1 DESCRIPTION
1572613Skris
1672613SkrisSSL_CTX_set_timeout() sets the timeout for newly created sessions for
1772613SkrisB<ctx> to B<t>. The timeout value B<t> must be given in seconds.
1872613Skris
1972613SkrisSSL_CTX_get_timeout() returns the currently set timeout value for B<ctx>.
2072613Skris
2172613Skris=head1 NOTES
2272613Skris
2372613SkrisWhenever a new session is created, it is assigned a maximum lifetime. This
2472613Skrislifetime is specified by storing the creation time of the session and the
2572613Skristimeout value valid at this time. If the actual time is later than creation
2672613Skristime plus timeout, the session is not reused.
2772613Skris
2872613SkrisDue to this realization, all sessions behave according to the timeout value
2972613Skrisvalid at the time of the session negotiation. Changes of the timeout value
3072613Skrisdo not affect already established sessions.
3172613Skris
3272613SkrisThe expiration time of a single session can be modified using the
3372613SkrisL<SSL_SESSION_get_time(3)|SSL_SESSION_get_time(3)> family of functions.
3472613Skris
3572613SkrisExpired sessions are removed from the internal session cache, whenever
3672613SkrisL<SSL_CTX_flush_sessions(3)|SSL_CTX_flush_sessions(3)> is called, either
3772613Skrisdirectly by the application or automatically (see
3872613SkrisL<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>)
3972613Skris
4089837SkrisThe default value for session timeout is decided on a per protocol
4189837Skrisbasis, see L<SSL_get_default_timeout(3)|SSL_get_default_timeout(3)>.
4289837SkrisAll currently supported protocols have the same default timeout value
4389837Skrisof 300 seconds.
4472613Skris
4572613Skris=head1 RETURN VALUES
4672613Skris
4772613SkrisSSL_CTX_set_timeout() returns the previously set timeout value.
4872613Skris
4972613SkrisSSL_CTX_get_timeout() returns the currently set timeout value.
5072613Skris
5172613Skris=head1 SEE ALSO
5272613Skris
5372613SkrisL<ssl(3)|ssl(3)>,
5472613SkrisL<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>,
5572613SkrisL<SSL_SESSION_get_time(3)|SSL_SESSION_get_time(3)>,
5689837SkrisL<SSL_CTX_flush_sessions(3)|SSL_CTX_flush_sessions(3)>,
5789837SkrisL<SSL_get_default_timeout(3)|SSL_get_default_timeout(3)>
5872613Skris
5972613Skris=cut
60