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"
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: rakesh@code2care.org
More Posts related to cURL,
- cURL Option to show HTTP Response Status Code
- URL Encode cURL HTTP GET\POST Data with Examples
- Capture cURL Request Output to a File
- Fix: Curl No Match Found Error
- trurl: A new command-line tool for URL parsing and manipulation by cURL Developer
- Send JSON Data as Payload using cURL HTTP POST Request
- cURL: Show Request and Response Headers
- Get cURL command from Chrome Inspect Network HTTP URL
- Save cURL Command Output to a external file
- cURL DELETE Request with Examples
- How to URL Encode Data for a cURL Request Parameters
- cURL Example using IP (IPv4 and IPv6) address and Port
- How to convert a Postman request to cURL Command
- [fix] command not found curl
- How to Pretty Print cURL JSON Output in Terminal
- How to follow redirects in cURL Command Request
- How to pass authorization header using cURL
- cURL -x Use of HTTP Proxy Server Examples
- Downloading Google Chrome using cURL Command
- How to get cURL Command to run in verbose mode?
- List of 28 Protocols supported by cURL with Examples
- Hide cURL Outputs and Errors on Terminal
- cURL -d Option with Examples
- How to show SSL Certificate details using cURL Command
- Perform Basic Authentication using cURL with Examples
More Posts:
- Find Nearest Gas Station using Google Map App on your Phone - Google
- Fix: ValueError: operands could not be broadcast together with shapes [Python numpy] - Python
- Fix: AssertionError in Python - Python
- Encode or Decode Base64 String using Mac Terminal Command - MacOS
- [Solved] SharePoint Illegal operation attempted on a registry key that has been marked for deletion - SharePoint
- Update Powershell Using Command Line - Powershell
- How to install python pip on Ubuntu using apt command - Linux
- Fix - sudo: systemctl: command not found - Ubuntu