SSL_get_peer_certificate
conn->ssl_cert = SSL_get_peer_certificate(conn->ssl);
cert = SSL_get_peer_certificate(ssl);