SSL_CTX_GET0_CERTIFICATE(3ssl)
π SSL_CTX_get0_certificate π
okay so bestie, welcome to the SSL_CTX_get0_certificate page from the 3ssl manual β like, the OpenSSL library functions manual, and honestly it's a short one but it's lowkey iconic. let's go π
πΈ NAME πΈ
SSL_CTX_get0_certificate β get the active certificate from an SSL context β¨
bestie it does exactly what it says on the tin, no cap
π¦ SYNOPSIS π¦
X509 *
SSL_CTX_get0_certificate(const SSL_CTX *ctx);
look at her. she's beautiful. one function, one pointer, zero drama π«Ά
π DESCRIPTION π
okay so the way that SSL_CTX_get0_certificate() works is β it returns an internal pointer to the ASN.1 certificate that's currently active in ctx π₯
and if nothing was ever installed with SSL_CTX_use_certificate(3) or similar functions? then it hits you with NULL π no certificate, no pointer, sad vibes
π¨ IMPORTANT CAVEAT, do not skip this bestie: the returned pointer must not be freed by the caller. like literally do NOT touch it with X509_free or anything else. it's not yours. it's the context's. respect the boundary π
π SEE ALSO π
go read these next, i promise they're worth it:
ssl(3)SSL_CTX_new(3)SSL_CTX_use_certificate(3)X509_get_pubkey(3)X509_get_subject_name(3)X509_new(3)
the whole friend group, honestly π
π HISTORY π
SSL_CTX_get0_certificate() first appeared in OpenSSL 1.0.2, and it's been available since OpenBSD 6.3. a whole journey, we love to see it β
and that's the page, bestie!! π this cutie was served to you by Debian, dated June 12, 2019 β SSL_CTX_GET0_CERTIFICATE(3) and we are OBSESSED πβ¨π§ββοΈ
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· OpenSSL
- Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms