X509 *SSL_get_peer_certificate(const SSL *ssl); SSL_get_peer_certificate () returns a pointer to the X509 certificate provided by the partner.
X509 *SSL_get_certificate(const SSL *ssl); The function returns an X.509 type pointer to a certificate loaded into the SSL structure.
The definition above is simple, as you mentioned in your answer
X509 *SSL_get_certificate(const SSL *s)
{
if (s->cert != NULL)
return(s->cert->key->x509);
else
return(NULL);
}
Below is a link for more information.
https://www.openssl.org/docs/manmaster/ssl/ssl.html
cmidi source
share