skip book previous and next navigation links
go up to top of book: HP Open Source Security for OpenVMS Volume 2:... HP Open Source Security for OpenVMS Volume 2:...
go to beginning of reference: SSL Application Programming Interface (API) Reference SSL Application Programming Interface (API) Reference
go to previous page: SSL_CTX_set_quiet_shutdown SSL_CTX_set_quiet_shutdown
go to next page: SSL_CTX_set_session_id_contextSSL_CTX_set_session_id_context
end of book navigation links


SSL_CTX_set_session_cache_mode
Description
Return Values
History
 Notes
See Also

NAME

SSL_CTX_set_session_cache_mode, SSL_CTX_get_session_cache_mode - enable/disable session caching

Synopsis  

#include <openssl/ssl.h>
long SSL_CTX_set_session_cache_mode(SSL_CTX ctx, long mode);
long SSL_CTX_get_session_cache_mode(SSL_CTX ctx);


return to top DESCRIPTION  

SSL_CTX_set_session_cache_mode() enables/disables session caching by setting the operational mode for ctx to <mode>.

SSL_CTX_get_session_cache_mode() returns the currently used cache mode.


return to top NOTES  

The OpenSSL library can store/retrieve SSL/TLS sessions for later reuse. The sessions can be held in memory for each ctx, if more than one SSL_CTX object is being maintained, the sessions are unique for each SSL_CTX object.

In order to reuse a session, a client must send the session's id to the server. It can only send exactly one id. The server then either agrees to reuse the session or it starts a full handshake (to create a new session).

A server will lookup up the session in its internal session storage. If the session is not found in internal storage or lookups for the internal storage have been deactivated (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP), the server will try the external storage if available.

Since a client may try to reuse a session intended for use in a different context, the session id context must be set by the server (see SSL_CTX_set_session_id_context(3) ).

The following session cache modes and modifiers are available:

The default mode is SSL_SESS_CACHE_SERVER.


return to top RETURN VALUES  

SSL_CTX_set_session_cache_mode() returns the previously set cache mode.

SSL_CTX_get_session_cache_mode() returns the currently set cache mode.


return to top SEE ALSO  

L<ssl>, SSL_set_session(3) , SSL_session_reused(3) , SSL_CTX_add_session(3) , SSL_CTX_sess_number(3) , SSL_CTX_sess_set_cache_size(3) , SSL_CTX_sess_set_get_cb(3) , SSL_CTX_set_session_id_context(3) , SSL_CTX_set_timeout(3) , SSL_CTX_flush_sessions(3)


return to top HISTORY  

SSL_SESS_CACHE_NO_INTERNAL_STORE and SSL_SESS_CACHE_NO_INTERNAL were introduced in OpenSSL 0.9.6h.
go to previous page: SSL_CTX_set_quiet_shutdown SSL_CTX_set_quiet_shutdown
go to next page: SSL_CTX_set_session_id_contextSSL_CTX_set_session_id_context