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" <blu-HfF3sdhuK0iTtA8H5PvdGFaTQe2KTcn/@public.gmane.org>
À: openssl-users-MCmKBN63+***@public.gmane.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-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org