SSL_CTX_GET0_CERTIFICATE(3ssl)

πŸ“¦ version 4.1.0, in opensuse-leap 16.0

πŸ’– 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:

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