Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Code Sample | Download Certificate

78 views
Skip to first unread message

Ranjith Venkatesh

unread,
Sep 15, 2010, 9:24:59 AM9/15/10
to
Is it possible to download a certificate given the website eg: https://domainX.com using openssl functions?
 
If yes, what are relevant functions and relevant code samples?
 
Ranjith Venkatesh

Website: www.ranjithvenkatesh.com

Wim Lewis

unread,
Sep 15, 2010, 2:18:19 PM9/15/10
to

On Sep 15, 2010, at 6:24 AM, Ranjith Venkatesh wrote:
> Is it possible to download a certificate given the website eg: https://domainX.com using openssl functions?
> If yes, what are relevant functions and relevant code samples?

It's possible to do this using "openssl s_client -showcerts". You can see an example if you look at the source of the s_client command (apps/s_client.c) --- call SSL_get_peer_certificate() or SSL_get_peer_cert_chain(), then do what you want with the returned cert (e.g. PEM_write_bio_X509()).


______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openss...@openssl.org
Automated List Manager majo...@openssl.org

0 new messages