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 -showcerts

Save only the Certificate:

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

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap