Cert expiry check (CI gate) openssl
Exit 0 if cert valid >24h; perfect for monitoring/CI alerts on expiry
openssl x509 -in cert.pem -noout -checkend 86400 && echo OK || echo EXPIRING
more openssl
all 27 commands →
Inspect live server chain
openssl s_client -connect <host>:443 -servername <host> -showcerts </dev/null 2>/dev/null
Extract SAN list
openssl x509 -in cert.pem -noout -ext subjectAltName
Verify cert against CA chain
openssl verify -CAfile ca-chain.pem cert.pem
Match cert and private key
diff <(openssl x509 -in cert.pem -noout -modulus | md5sum) <(openssl rsa -in key.pem -noout -modulus | md5sum)
CSR + key in one shot
openssl req -new -newkey rsa:2048 -nodes -keyout key.pem -out req.csr -subj "/CN=<host>" -addext "subjectAltName=DNS:<host>"