@@ -49,12 +49,16 @@ No session caching for client or server takes place.
4949
5050=item SSL_SESS_CACHE_CLIENT
5151
52- Client sessions are added to the session cache. As there is no reliable way
53- for the OpenSSL library to know whether a session should be reused or which
54- session to choose (due to the abstract BIO layer the SSL engine does not
55- have details about the connection), the application must select the session
56- to be reused by using the L<SSL_set_session(3)>
57- function. This option is not activated by default.
52+ Client sessions are added to the session cache. Sessions are identified by their
53+ cache identifier set via L<SSL_set1_cache_id(3)> when they are created by an SSL.
54+ This cache identifier must be set before calling L<SSL_connect(3)>.
55+
56+ The application then can retrieve prior sessions via L<SSL_get1_previous_client_session(3)>.
57+ After the session has been retrieved, it may be examined to determine whether
58+ it can (or should) be used. The session must then be applied to the SSL object via the
59+ L<SSL_set_session(3)> before it can be used during L<SSL_connect(3)>.
60+
61+ This option is not activated by default.
5862
5963=item SSL_SESS_CACHE_SERVER
6064
@@ -64,10 +68,19 @@ the internal session cache (unless SSL_SESS_CACHE_NO_INTERNAL_LOOKUP is set),
6468then (second) in the external cache if available. If the session is found, the
6569server will try to reuse the session. This is the default.
6670
71+ Servers must not use L<SSL_set1_cache_id(3)>, otherwise, the session will not be
72+ found in the cache.
73+
6774=item SSL_SESS_CACHE_BOTH
6875
6976Enable both SSL_SESS_CACHE_CLIENT and SSL_SESS_CACHE_SERVER at the same time.
7077
78+ Servers must not use L<SSL_set1_cache_id(3)>, otherwise, the session will not be
79+ found in the cache.
80+
81+ Clients must use L<SSL_set1_cacheid(3)> in order for sessions to be found in the cache
82+ via L<SSL_get1_previous_client_session(3)>.
83+
7184=item SSL_SESS_CACHE_NO_AUTO_CLEAR
7285
7386Normally the session cache is checked for expired sessions every
@@ -121,22 +134,25 @@ SSL_CTX_set_session_cache_mode() returns the previously set cache mode.
121134
122135SSL_CTX_get_session_cache_mode() returns the currently set cache mode.
123136
124-
125137=head1 SEE ALSO
126138
127139L<ssl(7)>, L<SSL_set_session(3)>,
128140L<SSL_session_reused(3)>,
141+ L<SSL_get0_cache_id(3)>,
142+ L<SSL_set1_cache_id(3)>,
143+ L<SSL_get1_previous_client_session(3)>,
129144L<SSL_CTX_add_session(3)>,
130145L<SSL_CTX_sess_number(3)>,
131146L<SSL_CTX_sess_set_cache_size(3)>,
132147L<SSL_CTX_sess_set_get_cb(3)>,
133148L<SSL_CTX_set_session_id_context(3)>,
134149L<SSL_CTX_set_timeout(3)>,
135- L<SSL_CTX_flush_sessions(3)>
150+ L<SSL_CTX_flush_sessions(3)>,
151+ L<SSL_connect(3)>
136152
137153=head1 COPYRIGHT
138154
139- Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
155+ Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved.
140156
141157Licensed under the Apache License 2.0 (the "License"). You may not use
142158this file except in compliance with the License. You can obtain a copy
0 commit comments