libressl-SSL_CTX_get0_certificate(3)

libressl-SSL_CTX_get0_certificate3

Get the active certificate from an ssl context

Usage

SSL Library (libssl, -lssl) libcrypto

#include <openssl/ssl.h>

X509 *

SSL_CTX_get0_certificate(const SSL_CTX *ctx);

Overview

The SSL_CTX_get0_certificate() function returns an internal pointer to the ASN.1 certificate currently active in ctx or NULL if none was installed with SSL_CTX_use_certificate(3) or similar functions.

The returned pointer must not be freed by the caller.

History

SSL_CTX_get0_certificate() first appeared in OpenSSL 1.0.2 and have been available since OpenBSD 6.3.

From libressl 4.4.0-1 in Arch Linux 2026-11-07. Parsed by carta from the page's mdoc source.