1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk KimSSL_CTX_flush_sessions - remove expired sessions 6e71b7053SJung-uk Kim 7e71b7053SJung-uk Kim=head1 SYNOPSIS 8e71b7053SJung-uk Kim 9e71b7053SJung-uk Kim #include <openssl/ssl.h> 10e71b7053SJung-uk Kim 11e71b7053SJung-uk Kim void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm); 12e71b7053SJung-uk Kim 13e71b7053SJung-uk Kim=head1 DESCRIPTION 14e71b7053SJung-uk Kim 15e71b7053SJung-uk KimSSL_CTX_flush_sessions() causes a run through the session cache of 16e71b7053SJung-uk KimB<ctx> to remove sessions expired at time B<tm>. 17e71b7053SJung-uk Kim 18e71b7053SJung-uk Kim=head1 NOTES 19e71b7053SJung-uk Kim 20e71b7053SJung-uk KimIf enabled, the internal session cache will collect all sessions established 21e71b7053SJung-uk Kimup to the specified maximum number (see SSL_CTX_sess_set_cache_size()). 22e71b7053SJung-uk KimAs sessions will not be reused ones they are expired, they should be 23e71b7053SJung-uk Kimremoved from the cache to save resources. This can either be done 24e71b7053SJung-uk Kimautomatically whenever 255 new sessions were established (see 25e71b7053SJung-uk KimL<SSL_CTX_set_session_cache_mode(3)>) 26e71b7053SJung-uk Kimor manually by calling SSL_CTX_flush_sessions(). 27e71b7053SJung-uk Kim 28e71b7053SJung-uk KimThe parameter B<tm> specifies the time which should be used for the 29e71b7053SJung-uk Kimexpiration test, in most cases the actual time given by time(0) 30e71b7053SJung-uk Kimwill be used. 31e71b7053SJung-uk Kim 32e71b7053SJung-uk KimSSL_CTX_flush_sessions() will only check sessions stored in the internal 33e71b7053SJung-uk Kimcache. When a session is found and removed, the remove_session_cb is however 34e71b7053SJung-uk Kimcalled to synchronize with the external cache (see 35e71b7053SJung-uk KimL<SSL_CTX_sess_set_get_cb(3)>). 36e71b7053SJung-uk Kim 37e71b7053SJung-uk Kim=head1 RETURN VALUES 38e71b7053SJung-uk Kim 39e71b7053SJung-uk KimSSL_CTX_flush_sessions() does not return a value. 40e71b7053SJung-uk Kim 41e71b7053SJung-uk Kim=head1 SEE ALSO 42e71b7053SJung-uk Kim 43e71b7053SJung-uk KimL<ssl(7)>, 44e71b7053SJung-uk KimL<SSL_CTX_set_session_cache_mode(3)>, 45e71b7053SJung-uk KimL<SSL_CTX_set_timeout(3)>, 46e71b7053SJung-uk KimL<SSL_CTX_sess_set_get_cb(3)> 47e71b7053SJung-uk Kim 48e71b7053SJung-uk Kim=head1 COPYRIGHT 49e71b7053SJung-uk Kim 50e71b7053SJung-uk KimCopyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. 51e71b7053SJung-uk Kim 52*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 53e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 54e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 55e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 56e71b7053SJung-uk Kim 57e71b7053SJung-uk Kim=cut 58