SSL_CTX_set_session_cache_mode(3) - NetBSD Manual Pages




SSL_CTX_set_session_cache_modOpenSL_CTX_set_session_cache_mode(3)



NAME
SSL_CTX_set_session_cache_mode, SSL_CTX_get_ses- sion_cache_mode - enable/disable session caching
LIBRARY
libcrypto, -lcrypto
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);
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.
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 main- tained, the sessions are unique for each SSL_CTX object. In order to reuse a session, a client must send the ses- sion's id to the server. It can only send exactly one id. The server then decides whether it agrees in reusing the session or starts the handshake for a new session. A server will lookup up the session in its internal ses- sion storage. If the session is not found in internal storage or internal storage is deactivated, 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 avail- able: SSL_SESS_CACHE_OFF No session caching for client or server takes place. SSL_SESS_CACHE_CLIENT Client sessions are added to the session cache. As there is no reliable way for the OpenSSL library to know whether a session should be reused or which ses- sion to choose (due to the abstract BIO layer the SSL engine does not have details about the connection), the application must select the session to be reused 2002-06-10 0.9.6g 1 SSL_CTX_set_session_cache_modOpenSL_CTX_set_session_cache_mode(3) by using the SSL_set_session(3) function. This option is not activated by default. SSL_SESS_CACHE_SERVER Server sessions are added to the session cache. When a client proposes a session to be reused, the session is looked up in the internal session cache. If the ses- sion is found, the server will try to reuse the ses- sion. This is the default. SSL_SESS_CACHE_BOTH Enable both SSL_SESS_CACHE_CLIENT and SSL_SESS_CACHE_SERVER at the same time. SSL_SESS_CACHE_NO_AUTO_CLEAR Normally the session cache is checked for expired ses- sions every 255 connections using the SSL_CTX_flush_sessions(3) function. Since this may lead to a delay which cannot be controlled, the auto- matic flushing may be disabled and SSL_CTX_flush_sessions(3) can be called explicitly by the application. SSL_SESS_CACHE_NO_INTERNAL_LOOKUP By setting this flag sessions are cached in the inter- nal storage but they are not looked up automatically. If an external session cache is enabled, sessions are looked up in the external cache. As automatic lookup only applies for SSL/TLS servers, the flag has no effect on clients. The default mode is SSL_SESS_CACHE_SERVER.
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.
SEE ALSO
ssl(3), SSL_set_session(3), SSL_session_reused(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) 2002-06-10 0.9.6g 2

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.