SSL_SESSION_SET1_ID(3ossl)
π SSL_SESSION_SET1_ID β bestie's guide to session IDs π
okay so this is an OpenSSL man page, section 3 (the 3ossl girlies know β¨). Two functions, one mission: grabbing and setting the SSL session ID. Let's get into it π«Ά
β¨ NAME β¨
SSL_SESSION_get_id, SSL_SESSION_set1_id β get and set the SSL session ID, no cap π
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,
unsigned int *len);
int SSL_SESSION_set1_id(SSL_SESSION *s, const unsigned char *sid,
unsigned int sid_len);
π¦ DESCRIPTION π¦
SSL_SESSION_get_id() hands you back a pointer to the internal session id value for the session s. Like, the actual one, living inside s β not a copy, bestie, an inside job π΅οΈβοΈ
The length of that id, in bytes, gets stashed into *len. And heads up: that length may be 0. Zero. Nada. It's allowed, don't panic π«
π IMPORTANT: the caller should not free the returned pointer directly. It's not yours to free! It belongs to the session. Do not touch. Do not free. Just vibe.
SSL_SESSION_set1_id() sets the session ID for the ssl SSL/TLS session s to sid, and that sid has length sid_len. Iconic behaviour honestly π
π RETURN VALUES π
SSL_SESSION_get_id()β returns a pointer to the session id value. That's it, that's the whole vibe.SSL_SESSION_set1_id()β returns1for success and0for failure. Like, for example, if the supplied session ID length exceedsSSL_MAX_SSL_SESSION_ID_LENGTH. Yeah. Too long. Rejected. π«
π SEE ALSO π
ssl(7)β go read her too, she's the main character π
β HISTORY β
The SSL_SESSION_set1_id() function was added in OpenSSL 1.1.0. She's been here since 1.1.0 and she's never left, periodt π§
π 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>.
and that's the whole page, bestie π tysm for reading β this one came straight out of 3.5.9, dated 2026-09-29, and it's still the SSL_SESSION_SET1_ID(3ossl) we know and love. mwah πβ¨
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms