1.\"
2.\"	$OpenBSD: SSL_CTX_flush_sessions.3,v 1.1 2016/11/05 15:32:19 schwarze Exp $
3.\"
4.Dd $Mdocdate: November 5 2016 $
5.Dt SSL_CTX_FLUSH_SESSIONS 3
6.Os
7.Sh NAME
8.Nm SSL_CTX_flush_sessions ,
9.Nm SSL_flush_sessions
10.Nd remove expired sessions
11.Sh SYNOPSIS
12.In openssl/ssl.h
13.Ft void
14.Fn SSL_CTX_flush_sessions "SSL_CTX *ctx" "long tm"
15.Ft void
16.Fn SSL_flush_sessions "SSL_CTX *ctx" "long tm"
17.Sh DESCRIPTION
18.Fn SSL_CTX_flush_sessions
19causes a run through the session cache of
20.Fa ctx
21to remove sessions expired at time
22.Fa tm .
23.Pp
24.Fn SSL_flush_sessions
25is a synonym for
26.Fn SSL_CTX_flush_sessions .
27.Sh NOTES
28If enabled, the internal session cache will collect all sessions established
29up to the specified maximum number (see
30.Fn SSL_CTX_sess_set_cache_size ) .
31As sessions will not be reused ones they are expired, they should be
32removed from the cache to save resources.
33This can either be done automatically whenever 255 new sessions were
34established (see
35.Xr SSL_CTX_set_session_cache_mode 3 )
36or manually by calling
37.Fn SSL_CTX_flush_sessions .
38.Pp
39The parameter
40.Fa tm
41specifies the time which should be used for the
42expiration test, in most cases the actual time given by
43.Fn time 0
44will be used.
45.Pp
46.Fn SSL_CTX_flush_sessions
47will only check sessions stored in the internal cache.
48When a session is found and removed, the
49.Va remove_session_cb
50is however called to synchronize with the external cache (see
51.Xr SSL_CTX_sess_set_get_cb 3 ) .
52.Sh RETURN VALUES
53.Sh SEE ALSO
54.Xr ssl 3 ,
55.Xr SSL_CTX_sess_set_get_cb 3 ,
56.Xr SSL_CTX_set_session_cache_mode 3 ,
57.Xr SSL_CTX_set_timeout 3
58