hi,

from a SSL object you can use SSL_get_peer_certificate

It does not really make sense to retrieve a peer certificate using SSL_CTX 
object since a connection is necessary in order to retrieve server certificate

However if you're on server side you can retrieve the certificate in two ways :
- first one is to use same source (file or X509) and just get the certificate 
instead of setting it
- second is to get the X509_STORE using SSL_CTX_get_cert_store and then use 
X509_STORE_CTX_get_current_cert


regards

----- Mail original -----
De: "Bin Lu" <b...@paloaltonetworks.com>
À: openssl-users@openssl.org
Envoyé: Samedi 20 Septembre 2014 03:41:28
Objet: retrieve server cert from SSL_CTX?




Hi, 



Is there any way to retrieve the server certificate from the SSL_CTX object? 



Thanks, 

-binlu
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to