有効期限切れが近づくと、次のようなメールが届きます。
件名: Let's Encrypt certificate expiration notice for domain "example.com"
Hello,
Your certificate (or certificates) for the names listed below will expire in 11 days (on 08 Apr 22 23:24 +0000). Please make sure to renew your certificate before then, or visitors to your web site will encounter errors.
We recommend renewing certificates automatically when they have a third of their total lifetime left. For Let's Encrypt's current 90-day certificates, that means renewing 30 days before expiration. See https://letsencrypt.org/docs/integration-guide/ for details.
example.com
ブラウザーで確認 ##
期限が 4月16日になっています。
ssh でログインして、証明書ファイルの期限を確認
期限が 6月15日になっています。
$ sudo openssl x509 -noout -dates -in /etc/letsencrypt/live/example.com/fullchain.pem
notBefore=Mar 17 23:51:22 2022 GMT
notAfter=Jun 15 23:51:21 2022 GMT
openssl で確認 ##
リモートで
期限が 4月16日になっています。
$ openssl s_client -connect example.com:443 < /dev/null 2> /dev/null | openssl x509 -text | grep "Not"
Not Before: Jan 16 07:30:04 2022 GMT
Not After : Apr 16 07:30:03 2022 GMT
localhostで
期限が 4月16日になっています。
$ openssl s_client -connect localhost:443 < /dev/null 2> /dev/null | openssl x509 -text | grep "Not"
Not Before: Jan 16 07:30:04 2022 GMT
Not After : Apr 16 07:30:03 2022 GMT
SSL Server Test で確認
SSL Server Test
期限が 4月16日になっています。
解決策
sudo systemctl restart nginx
期限が 6月15日になりました。
原因不明ですが、cron で証明書を更新したあとの nginx の再起動が働いていなかったようです。