skip to content
Alvin Lucillo

Review server SSL certs

/ 1 min read

We can get cert information from the server by sending a HEAD request instead of get (-I) and showing more details (-v). Redirect the output from stderr to stdout, so we can use it with grep. Search for the cert keywords using extended regex (-E).

The response shows the CAfile referened by curl and server’s cert details such as the certificate chain and for whom the cert is issued for.

curl -vI https://jsonplaceholder.typicode.com/ 2>&1 | grep -E "(certificate|issuer|subject)"
*  CAfile: /etc/ssl/certs/ca-certificates.crt
* Server certificate:
*  subject: CN=typicode.com
*  subjectAltName: host "jsonplaceholder.typicode.com" matched cert's "*.typicode.com"
*  issuer: C=US; O=Google Trust Services; CN=WE1
*  SSL certificate verify ok.