SSL_SESSION_GET0_PEER(3ossl)
π SSL_SESSION_GET0_PEER π
okay so bestie, welcome to the SSL_SESSION_get0_peer page β that's page 3ossl of the OpenSSL manual, and it's literally one of the shortest, most chill pages you'll ever read. no cap. let's get into it π«Ά
β¨ NAME β¨
SSL_SESSION_get0_peer β get the deets about the peer's certificate for a session π
like, that's the whole vibe. you have a session, you wanna know who's on the other end, this is your girl.
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
X509 *SSL_SESSION_get0_peer(SSL_SESSION *s);
yes that's it. one include, one function, one argument. iconic minimalism, honestly π
π¦ DESCRIPTION π¦
okay so SSL_SESSION_get0_peer() returns the peer certificate associated with the session s, or NULL if no peer certificate is available. π
but listen β the caller should NOT free the returned value (unless X509_up_ref(3) has also been called). like, do not touch it. do not free it. it is not yours to free. it's giving "borrowed, not given" energy and honestly respect π
β οΈ bestie please internalise that. freeing it without callingX509_up_ref(3)first is a whole mess you do not want. the only exception is ifX509_up_ref(3)was also called β then you're allowed. periodt.
β RETURN VALUES β
SSL_SESSION_get0_peer() returns a pointer to the peer certificate, or NULL if no peer certificate is available. π
so like, two possible outcomes:
- pointer to the peer certificate π
NULL, meaning no peer certificate is available π
that's the vibe check, and it passed.
π SEE ALSO π
ssl(7)β go read it, iykyk π§
π COPYRIGHT π
Copyright 2017 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 β short, sweet, and lowkey perfect. this one's from OpenSSL 3.5.6, dated 2026-04-07, and it lives at SSL_SESSION_GET0_PEER(3ossl). mwah πππ¦
π¦ 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