SSL_CTX_SET_SESSION_ID_CONTEXT - Online Linux Manual PageSection : 3
Updated : 2021-03-26
Source : 1.1.1k
Note : OpenSSL

NAMESSL_CTX_set_session_id_context, SSL_set_session_id_context − set context within which session can be reused (server side only)

SYNOPSIS​ #include <openssl/ssl.h> ​ ​ int 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);

DESCRIPTIONSSL_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.

NOTESSessions are generated within a certain context. When exporting/importing sessions with i2d_SSL_SESSION/d2i_SSL_SESSION 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 e.g. the name of the application and/or the hostname and/or service name ... The session id context becomes part of the session. The session id context is set by the SSL/TLS server. The SSL_CTX_set_session_id_context() and ​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_MAX_SID_CTX_LENGTH.

WARNINGSIf the session id context is not set on an SSL/TLS server and client certificates are used, stored sessions will not be reused but a fatal error will be flagged and the handshake will fail. If a server returns a different session id context to an OpenSSL client when reusing a session, an error will be flagged and the handshake will fail. OpenSSL servers will always return the correct session id context, as an OpenSSL server checks the session id context itself before reusing a session as described above.

RETURN VALUESSSL_CTX_set_session_id_context() and 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_SID_CTX_LENGTH. The error is logged to the error stack. The operation succeeded.

SEE ALSOssl(7)

COPYRIGHTCopyright 2001−2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the License). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
0
Johanes Gumabo
Data Size   :   9,342 byte
man-S___SL_CTX_set_session_id_context.3sslBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 199,794
Visitor ID   :     :  
Visitor IP   :   3.144.252.243   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|S___SL_CTX_set_session_id_context.3ssl|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|S___SL_CTX_set_session_id_context.3ssl|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|S___SL_CTX_set_session_id_context.3ssl|43|br══─}─══|'br══─}─══ )         (htmlprn|149|S___SL_CTX_set_session_id_context.3ssl|43|'br══─}─══ |'br══─}─══ )