⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssl_ctx_set_session_cache_mode.pod

📁 开源的ssl算法openssl,版本0.9.8H
💻 POD
字号:
=pod=head1 NAMESSL_CTX_set_session_cache_mode, SSL_CTX_get_session_cache_mode - enable/disable session caching=head1 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);=head1 DESCRIPTIONSSL_CTX_set_session_cache_mode() enables/disables session cachingby setting the operational mode for B<ctx> to <mode>.SSL_CTX_get_session_cache_mode() returns the currently used cache mode.=head1 NOTESThe OpenSSL library can store/retrieve SSL/TLS sessions for later reuse.The sessions can be held in memory for each B<ctx>, if more than oneSSL_CTX object is being maintained, the sessions are unique for each SSL_CTXobject.In order to reuse a session, a client must send the session's id to theserver. 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 newsession).A server will lookup up the session in its internal session storage. If thesession is not found in internal storage or lookups for the internal storagehave been deactivated (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP), the server will trythe external storage if available.Since a client may try to reuse a session intended for use in a differentcontext, the session id context must be set by the server (seeL<SSL_CTX_set_session_id_context(3)|SSL_CTX_set_session_id_context(3)>).The following session cache modes and modifiers are available:=over 4=item SSL_SESS_CACHE_OFFNo session caching for client or server takes place.=item SSL_SESS_CACHE_CLIENTClient sessions are added to the session cache. As there is no reliable wayfor the OpenSSL library to know whether a session should be reused or whichsession to choose (due to the abstract BIO layer the SSL engine does nothave details about the connection), the application must select the sessionto be reused by using the L<SSL_set_session(3)|SSL_set_session(3)>function. This option is not activated by default.=item SSL_SESS_CACHE_SERVERServer sessions are added to the session cache. When a client proposes asession to be reused, the server looks for the corresponding session in (first)the internal session cache (unless SSL_SESS_CACHE_NO_INTERNAL_LOOKUP is set),then (second) in the external cache if available. If the session is found, theserver will try to reuse the session.  This is the default.=item SSL_SESS_CACHE_BOTHEnable both SSL_SESS_CACHE_CLIENT and SSL_SESS_CACHE_SERVER at the same time.=item SSL_SESS_CACHE_NO_AUTO_CLEARNormally the session cache is checked for expired sessions every255 connections using theL<SSL_CTX_flush_sessions(3)|SSL_CTX_flush_sessions(3)> function. Sincethis may lead to a delay which cannot be controlled, the automaticflushing may be disabled andL<SSL_CTX_flush_sessions(3)|SSL_CTX_flush_sessions(3)> can be calledexplicitly by the application.=item SSL_SESS_CACHE_NO_INTERNAL_LOOKUPBy setting this flag, session-resume operations in an SSL/TLS server will notautomatically look up sessions in the internal cache, even if sessions areautomatically stored there. If external session caching callbacks are in use,this flag guarantees that all lookups are directed to the external cache.As automatic lookup only applies for SSL/TLS servers, the flag has no effect onclients.=item SSL_SESS_CACHE_NO_INTERNAL_STOREDepending on the presence of SSL_SESS_CACHE_CLIENT and/or SSL_SESS_CACHE_SERVER,sessions negotiated in an SSL/TLS handshake may be cached for possible reuse.Normally a new session is added to the internal cache as well as any externalsession caching (callback) that is configured for the SSL_CTX. This flag willprevent sessions being stored in the internal cache (though the application canadd them manually using L<SSL_CTX_add_session(3)|SSL_CTX_add_session(3)>). Note:in any SSL/TLS servers where external caching is configured, any successfulsession lookups in the external cache (ie. for session-resume requests) wouldnormally be copied into the local cache before processing continues - this flagprevents these additions to the internal cache as well.=item SSL_SESS_CACHE_NO_INTERNALEnable both SSL_SESS_CACHE_NO_INTERNAL_LOOKUP andSSL_SESS_CACHE_NO_INTERNAL_STORE at the same time.=backThe default mode is SSL_SESS_CACHE_SERVER.=head1 RETURN VALUESSSL_CTX_set_session_cache_mode() returns the previously set cache mode.SSL_CTX_get_session_cache_mode() returns the currently set cache mode.=head1 SEE ALSOL<ssl(3)|ssl(3)>, L<SSL_set_session(3)|SSL_set_session(3)>,L<SSL_session_reused(3)|SSL_session_reused(3)>,L<SSL_CTX_add_session(3)|SSL_CTX_add_session(3)>,L<SSL_CTX_sess_number(3)|SSL_CTX_sess_number(3)>,L<SSL_CTX_sess_set_cache_size(3)|SSL_CTX_sess_set_cache_size(3)>,L<SSL_CTX_sess_set_get_cb(3)|SSL_CTX_sess_set_get_cb(3)>,L<SSL_CTX_set_session_id_context(3)|SSL_CTX_set_session_id_context(3)>,L<SSL_CTX_set_timeout(3)|SSL_CTX_set_timeout(3)>,L<SSL_CTX_flush_sessions(3)|SSL_CTX_flush_sessions(3)>=head1 HISTORYSSL_SESS_CACHE_NO_INTERNAL_STORE and SSL_SESS_CACHE_NO_INTERNALwere introduced in OpenSSL 0.9.6h.=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -