libressl-SSL_get_certificate3
Get ssl certificate and private key
Usage
SSL Library (libssl, -lssl) libcrypto
#include <openssl/ssl.h>
X509 *
SSL_get_certificate(const SSL *ssl);
EVP_PKEY *
SSL_get_privatekey(const SSL *ssl);
Overview
These functions retrieve certificate and key data from an SSL object. They return internal pointers that must not be freed by the application program.
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.