Download a SSL Certificate from a URL in Terminal

To download an SSL certificate from a website/URL to your local computer using the openssl as follows,

See Details:

openssl s_client -connect code2care.org:443 -showcerts

Save only the Certificate:

openssl s_client -connect code2care.org:443 -showcerts 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > cert.pem
Download Certificate on Local System

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!