SSL_GET_CERTIFICATE(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’… SSL_GET_CERTIFICATE(3) πŸ’…

hiii bestie, welcome to the SSL_GET_CERTIFICATE(3) manual page β€” this is the one about pulling certificate + private-key data out of an SSL object, and it is very much giving β€œinternal pointers, do not touch” energy. 🫢


🌸 NAME 🌸

SSL_get_certificate, SSL_get_privatekey β€” get SSL certificate and private key

✨ SYNOPSIS ✨

okay so the signatures are literally right here, no cap:

library β€œlibssl” libcrypto #include <openssl/ssl.h>

X509 *
SSL_get_certificate(const SSL *ssl);

EVP_PKEY *
SSL_get_privatekey(const SSL *ssl);

πŸ¦‹ DESCRIPTION πŸ¦‹

These functions retrieve certificate and key data from an SSL object, bestie. They hand you back internal pointers β€” and those pointers must not be freed by the application program.

⚠️ girlies please listen: internal pointers are not yours to free. the application program must not free them. periodt. πŸ’€

πŸŽ€ RETURN VALUES πŸŽ€

  • SSL_get_certificate() β€” returns the active X.509 certificate currently used by ssl, or NULL if none is active. πŸŽ€
  • SSL_get_privatekey() β€” returns the active private key currently used by ssl, or NULL if none is active. πŸ”‘

πŸ”₯ SEE ALSO πŸ”₯

go check out these other icons too:

πŸ’œ HISTORY πŸ’œ

SSL_get_certificate() first appeared in SSLeay 0.5.2a. SSL_get_privatekey() first appeared in SSLeay 0.8.0. Both functions have been available since OpenBSD 2.4. ⭐


okay that’s the whole vibe check, bestie β€” mwah! πŸ’‹ this page is from Debian, dated June 8, 2025, and you just read SSL_GET_CERTIFICATE(3). πŸ¦‹

πŸ“¦ where this page comes from