Interview Prep/Networking/Command-Line Tools & Diagnostics

How do you inspect an HTTPS server with `openssl` and `curl` for expiry monitoring?

IntermediateConceptCommand-Line Tools & Diagnostics
Answer
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -enddate
openssl x509 -checkend 1209600 -noout -in cert.pem && echo ok || echo "expires within 14 days"
curl -vI https://example.com 2>&1 | grep -E "expire date|subject:|issuer:"

Feed the first command into cron or a Prometheus blackbox exporter and alert at 21 and 7 days.

All Networking questions Roadmap: Networking for DevOps

More on Command-Line Tools & Diagnostics