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: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

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