SSL_SESSION_GET0_CIPHER(3)
π SSL_SESSION_get0_cipher(3) β the manual page, but make it make sense π
okay bestie, so we're in the libssl / libcrypto cinematic universe today, and this one's a lil function that answers one very specific question: what cipher did this session use? iconic behavior honestly β¨
β¨ SYNOPSIS β¨
Header you're gonna want:
#include <openssl/ssl.h>
And the signature, exactly as it lives:
const SSL_CIPHER *
SSL_SESSION_get0_cipher(const SSL_SESSION *session);
that's it. that's the whole vibe. π¦
πΈ DESCRIPTION πΈ
SSL_SESSION_get0_cipher() retrieves the cipher that was used by the connection when the session was created. so it's like, the receipts of which cipher this session vibed with back in the day π
if it cannot be determined, you get NULL. no cipher, no plot, just NULL. π
and now the important part, bestie, pay attention: the value returned is a pointer to an object maintained within session β so do not release it. not your pointer to free, not your moment, hands off π the session owns that object, you're just borrowing it for the aesthetic.
β RETURN VALUES β
SSL_SESSION_get0_cipher()returns theSSL_CIPHERassociated withsessionβ the main character π- or
NULLif it cannot be determined β the flop ending π
π SEE ALSO π
the whole friend group, go say hi:
π¦ HISTORY π¦
the lore: SSL_SESSION_get0_cipher() first appeared in OpenSSL 1.1.0, and has been available since OpenBSD 7.0. periodt. π₯
and that's the page, bestie π«Ά this lil drop was brought to you by Debian, dated June 8, 2025 β go forth and check your session ciphers responsibly πβ¨
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2016, 2017 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms