Skip to content

02 Nov 2026 1 min read

Certificate Management

Here are some useful commands I use regularly for certificates management.

Generate a self-signed certificate

openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -keyout node_exporter.key -out node_exporter.crt -subj "/CN=*.domain.com" -addext "subjectAltName = DNS:*.domain.com"

Check the Status of a Certificate

openssl x509 -in mycert.pem -text -noout

Determine SSL cert expiration date

openssl x509 -enddate -noout -in /etc/ssl/private/lan.domain.cer

Check either certificate is expired at a given date (in second)

openssl x509 -checkend 2592000 -in cert.crt

Check server certificate

openssl s_client -host www.google.com -port 443