How to show SSL Certificate details using cURL Command



If you want to know SSL Certificate details for a URL using cURL, you can connect to the server at 443 port or HTTPS protocol with --verbose flag.

Example:

curl --verbose https://code2care.org

*   Trying 172.67.164.66:443...
* Connected to code2care.org (172.67.164.66) port 443 (#0)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN: server accepted h2

* Server certificate:
*  subject: CN=code2care.org
*  start date: Jul  9 03:53:07 2023 GMT
*  expire date: Oct  7 03:53:06 2023 GMT
*  subjectAltName: host "code2care.org" matched cert's "code2care.org"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1P5
*  SSL certificate verify ok.

You will see all details related to the Server SSL under "Server certificate"

Show SSL Certificate details using cURL Command
-

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


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