Sortix 1.1dev nightly manual
This manual documents Sortix 1.1dev nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
|SSL_CTX_SET_SESSION_ID_CONTEXT(3)||Library Functions Manual||SSL_CTX_SET_SESSION_ID_CONTEXT(3)|
set context within which session can be reused (server side only)
SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx, unsigned int sid_ctx_len); int
SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx, unsigned int sid_ctx_len);
SSL_CTX_set_session_id_context() sets the context sid_ctx of length sid_ctx_len within which a session can be reused for the ctx object.
SSL_set_session_id_context() sets the context sid_ctx of length sid_ctx_len within which a session can be reused for the ssl object. Sessions are generated within a certain context. When exporting/importing sessions with i2d_SSL_SESSION(3) and d2i_SSL_SESSION(3), it would be possible to re-import a session generated from another context (e.g., another application), which might lead to malfunctions. Therefore each application must set its own session id context sid_ctx which is used to distinguish the contexts and is stored in exported sessions. The sid_ctx can be any kind of binary data with a given length; it is therefore possible to use, for instance, the name of the application, the hostname, the service name... The session id context becomes part of the session. The session id context is set by the SSL/TLS server. The
SSL_set_session_id_context() functions are therefore only useful on the server side. OpenSSL clients will check the session id context returned by the server when reusing a session. The maximum length of the sid_ctx is limited to
SSL_set_session_id_context() return the following values:
- The length sid_ctx_len of the session id
context sid_ctx exceeded the maximum
allowed length of
SSL_MAX_SSL_SESSION_ID_LENGTH. The error is logged to the error stack.
- The operation succeeded.
SSL_set_session_id_context() first appeared in OpenSSL 0.9.2b.
SSL_CTX_set_session_id_context() first appeared in OpenSSL 0.9.3. Both functions have been available since OpenBSD 2.6.
|June 8, 2019||Debian|