SSL_SESSION_SET1_ID(3ossl)
π SSL_SESSION_SET1_ID π
okay bestie, so this one's from the OpenSSL fam β it's the 3ossl manual page and it's literally all about getting and setting the SSL session ID. tiny page, big main character energy. let's get into it π
β¨ NAME β¨
SSL_SESSION_get_id, SSL_SESSION_set1_id β like, the getter and the setter for the SSL session ID. grab it, or yeet a new one in. that's the whole vibe π¦
πΈ 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);
yup, that's the whole thing. two functions, no cap π
π DESCRIPTION π
SSL_SESSION_get_id() π«Ά
this one hands you back a pointer to the internal session id value for the session s. the length of that id, in bytes, gets stashed in *len. and like β the length may be 0, so don't freak out if you get a zero, it's valid, it's allowed, it's fine π§
β οΈ bestie, listen to me: the caller should not free the returned pointer directly. it's the library's pointer, not yours. hands off π
SSL_SESSION_set1_id() π«
this one sets the session ID for the ssl SSL/TLS session to sid, of length sid_len. that's it, that's the whole job. iconic, honestly π
π₯ RETURN VALUES π₯
SSL_SESSION_get_id()β returns a pointer to the session id value. simple as πSSL_SESSION_set1_id()β returns1for success and0for failure. and when does it fail? for example, if the supplied session ID length exceedsSSL_MAX_SSL_SESSION_ID_LENGTH. so like, don't overstuff it, it's not a suitcase π
π¦ SEE ALSO π¦
ssl(7)β go read it, iykyk β¨
π HISTORY π
the SSL_SESSION_set1_id() function was added in OpenSSL 1.1.0. so it's been around a minute, lowkey vintage π
π 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 tea, bestie π this was SSL_SESSION_SET1_ID(3ossl) from OpenSSL 3.5.6, dated 2026-04-07 β slay, go forth and manage those session IDs responsibly π
π
π¦ 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