0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Let's Encrypt で証明書の期限が迫ってきたというメールが来た時の対応

Posted at

有効期限切れが近づくと、次のようなメールが届きます。

件名:	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 の再起動が働いていなかったようです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?