SSL_SESSION_GET_ID(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

✨ NAME ✨

Okay so bestie, welcome to the SSL_SESSION_GET_ID(3) page β€” yes, that's the manual name, from the Library Functions Manual β€” and it's giving the get-and-set duo for the SSL session ID: SSL_SESSION_get_id and SSL_SESSION_set1_id. Slay. πŸŽ€

🌸 SYNOPSIS 🌸

No cap, here's the exact synopsis block β€” formatting kept exactly as-is, bestie:

library β€œlibssl” libcrypto #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 πŸ’œ

Now for the vibe check. SSL_SESSION_get_id() returns a pointer to the internal session ID value for the session s. The length of the ID in bytes is stored in *len β€” the way that works is lowkey cute. The length may be 0. The caller should not free the returned pointer directly β€” highkey do not do it, bestie. πŸš«πŸ’…

SSL_SESSION_set1_id() sets the session ID for s to a copy of sid of length sid_len. It's a copy situation, iykyk. πŸ¦‹

⭐ RETURN VALUES ⭐

Return-value tea, served hot:

  • SSL_SESSION_get_id() β€” returns a pointer to the session ID value. You get the pointer, periodt. πŸ‘‘
  • SSL_SESSION_set1_id() β€” returns 1 for success and 0 for failure, for example if the supplied session ID length exceeds SSL_MAX_SSL_SESSION_ID_LENGTH. Ngl, that cap is real, bestie β€” exceeding it is a no. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Obsessed with cross-references? Same. Go read these next: ssl(3), SSL_copy_session_id(3), SSL_get_session(3), SSL_SESSION_get_compress_id(3), SSL_SESSION_get_protocol_version(3), SSL_SESSION_has_ticket(3), SSL_SESSION_new(3). Fr fr, the whole squad is here. 🫢

🌈 HISTORY 🌈

History lesson, because we love lore:

  • SSL_SESSION_get_id() β€” first appeared in OpenSSL 0.9.8 and has been available since OpenBSD 4.5. ⭐
  • SSL_SESSION_set1_id() β€” first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 6.3. 🌈

xoxo, this page ate β€” it's from Debian, dated June 8, 2025, and the manual page is SSL_SESSION_GET_ID(3) β€” periodt. πŸ’…πŸ«Ά

πŸ“¦ where this page comes from