📄 ssl_ctx_add_session.pod
字号:
=pod=head1 NAMESSL_CTX_add_session, SSL_add_session, SSL_CTX_remove_session, SSL_remove_session - manipulate session cache=head1 SYNOPSIS #include <openssl/ssl.h> int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c); int SSL_add_session(SSL_CTX *ctx, SSL_SESSION *c); int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c); int SSL_remove_session(SSL_CTX *ctx, SSL_SESSION *c);=head1 DESCRIPTIONSSL_CTX_add_session() adds the session B<c> to the context B<ctx>. Thereference count for session B<c> is incremented by 1. If a session withthe same session id already exists, the old session is removed by callingL<SSL_SESSION_free(3)|SSL_SESSION_free(3)>.SSL_CTX_remove_session() removes the session B<c> from the context B<ctx>.L<SSL_SESSION_free(3)|SSL_SESSION_free(3)> is called once for B<c>.SSL_add_session() and SSL_remove_session() are synonyms for theirSSL_CTX_*() counterparts.=head1 NOTESWhen adding a new session to the internal session cache, it is examinedwhether a session with the same session id already exists. In this caseit is assumed that both sessions are identical. If the same session isstored in a different SSL_SESSION object, The old session isremoved and replaced by the new session. If the session is actuallyidentical (the SSL_SESSION object is identical), SSL_CTX_add_session()is a no-op, and the return value is 0.If a server SSL_CTX is configured with the SSL_SESS_CACHE_NO_INTERNAL_STOREflag then the internal cache will not be populated automatically by newsessions negotiated by the SSL/TLS implementation, even though the internalcache will be searched automatically for session-resume requests (thelatter can be surpressed by SSL_SESS_CACHE_NO_INTERNAL_LOOKUP). So theapplication can use SSL_CTX_add_session() directly to have full controlover the sessions that can be resumed if desired.=head1 RETURN VALUESThe following values are returned by all functions:=over 4=item 0 The operation failed. In case of the add operation, it was tried to add the same (identical) session twice. In case of the remove operation, the session was not found in the cache.=item 1 The operation succeeded.=back=head1 SEE ALSOL<ssl(3)|ssl(3)>,L<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>,L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>=cut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -