プロジェクトのSSL証明書は/etc/letsencrypt/archive
に保存されています。
証明書を更新するたびに証明書が増えて、cert.pem
、cert2.pem
、cert3.pem
…と増えていきます。
(/etc/letsencrypt/live/example.com/
には最新のものへのシンボリックリンクが保存される)
証明書の有効期限を知りたいことがありました。
その場合のコマンドをメモしておきます。
cert3.pem
の有効期限を知りたい場合↓
[user@ip-172-8-0-10 example.com]$ cd /etc/letsencrypt/archive/example.com
[user@ip-172-8-0-10 example.com]$ openssl x509 -noout -subject -dates -in cert3.pem
subject= /CN=example.com
notBefore=Jan 14 17:32:01 2023 GMT
notAfter=Apr 14 17:32:00 2023 GMT
notBefore
が有効になった日時、notAfter
が有効期限の日時。
参考: