SSL_SESSION_GET0_ID_CONTEXT(3ossl)
π SSL_SESSION_GET0_ID_CONTEXT(3ossl) β like, the actual OpenSSL man page, bestie
okay so this is the 3ossl manual page for SSL_SESSION_get0_id_context and SSL_SESSION_set1_id_context, and yes it's an OpenSSL one β get and set the SSL ID context associated with a session. very niche, very important, we love a niche little function π
β¨ NAME β¨
SSL_SESSION_get0_id_context, SSL_SESSION_set1_id_context β get and set the SSL ID context associated with a session π«Ά
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
const unsigned char *SSL_SESSION_get0_id_context(const SSL_SESSION *s,
unsigned int *len);
int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,
unsigned int sid_ctx_len);
like. literally just include <openssl/ssl.h> and you're in π
π¦ DESCRIPTION π¦
first off β if you want the full lore on session ID contexts, go read SSL_CTX_set_session_id_context(3). that's where the details live, iykyk.
SSL_SESSION_get0_id_context() returns the ID context associated with the SSL/TLS session s. and the length of that ID context gets written to *len β but only if len is not NULL. so like, don't pass NULL and then be shocked there's no length, bestie π
heads up: the value returned is a pointer to an object maintained within s and should not be released. that's not yours, babes. do not free it. walking away is the correct move π
SSL_SESSION_set1_id_context() takes a copy of the ID context you hand it in sid_ctx and associates it with the session s. the length of that ID context is given by sid_ctx_len, which must not exceed SSL_MAX_SID_CTX_LENGTH bytes. no cap, that's the ceiling β go over it and we have a problem β¨
π RETURN VALUES π
SSL_SESSION_set1_id_context() returns 1 on success or 0 on error. that's it, that's the whole vibe check. slay. π
π SEE ALSO π
β HISTORY β
SSL_SESSION_get0_id_context() function was added in OpenSSL 1.1.0. iconic behaviour, honestly π
π COPYRIGHT π
Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (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>.
k that's the whole page, mwah π this was OpenSSL 3.5.6, dated 2026-04-07, and the manual page is SSL_SESSION_GET0_ID_CONTEXT(3ossl) β go forth and set your session ID contexts responsibly, bestie π§ββοΈπ
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms