SSL_SESSION_GET0_PEER(3)
β¨ SSL_SESSION_GET0_PEER β¨
okay so bestie, welcome to libssl / libcrypto β the <openssl/ssl.h> era of your life π
this one's a tiny little function page but it's lowkey important, so let's get into it π«Ά
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
X509 *
SSL_SESSION_get0_peer(SSL_SESSION *s);
π¦ DESCRIPTION π¦
SSL_SESSION_get0_peer() hands you back a pointer to the peer certificate that's associated with the session s β like, the actual cert of the other side of the conversation π and if there's no peer certificate available at all? it just gives you NULL. no drama, no error, just NULL. π
π¨ the big rule, bestie: the caller should not free the returned value β unless X509_up_ref(3) has also been called. so like, don't go freeing that pointer on your own, that's not your business, that pointer isn't yours to yeet π please respect the refcount.
it's giving "look but don't touch" energy fr fr β¨
π SEE ALSO π
go read those too, they're iconic in their own right π
π HISTORY π
SSL_SESSION_get0_peer() first appeared in OpenSSL 1.0.1, and it's been available since OpenBSD 5.3. so she's been serving since forever β a true veteran π
β
okay that's the whole page, you ate that π this was Debian's rendering, dated June 8, 2025 β and yes, the page title matches the name up top, no cap π mwah, go forth and check those peer certs 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) 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