SSL_SESSION_GET0_PEER(3SSL)
π SSL_SESSION_get0_peer β the 3SSL manual, bestie edition π
okay so you're in the 3SSL section of the OpenSSL manuals, and this one is genuinely so short and so sweet. it's giving "small function, big main character energy" β¨
πΈ NAME πΈ
SSL_SESSION_get0_peer β get details about peer's certificate for a session π«Ά
like. that's the whole gig. you hand it a session, it hands you the cert.
π¦ SYNOPSIS π¦
#include <openssl/ssl.h>
X509 *SSL_SESSION_get0_peer(SSL_SESSION *s);
no cap, that's it. one include, one function, one line π
π DESCRIPTION π
okay so SSL_SESSION_get0_peer() returns the peer certificate that's associated with the session s β or NULL if there is no peer certificate available. that's the whole vibe check.
the s is your SSL_SESSION *, and the thing it gives back is an X509 *. iconic.
π IMPORTANT ONE, DO NOT SKIP: the caller should not free the returned value. like, do notX509_free()it, bestie, that's not yours. the only exception is ifX509_up_ref(3)has also been called β then you've bumped the ref count and now you're a co-owner and you can free your share. otherwise: hands off, no touching, look but don't free π
β RETURN VALUES β
SSL_SESSION_get0_peer()returns a pointer to the peer certificate π- or
NULLif no peer certificate is available π
that's the whole range. two outcomes. perfection.
π SEE ALSO π
go read that one too, it's the gateway drug, fr fr π§
π 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 page, bestie!! slay, periodt, ate and left no crumbs π β¨
this lil gem is from OpenSSL 4.0.3, dated 2026-09-29, and it lives under the name SSL_SESSION_GET0_PEER(3SSL). take care of her π«Άππ¦
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms