LoginSignup
4
4

More than 5 years have passed since last update.

Mastodon のSSL証明書の有効期限確認

Last updated at Posted at 2017-09-11

TL;DR

マストドンのSSL証明書(Let's Encrypt)の有効期限を確認するには、rootで下記2コマンドを実行します。sample.comは自分のドメインに変えてください。

DOMAIN=sample.com
openssl s_client -connect ${DOMAIN}:443 < /dev/null 2> /dev/null | openssl x509 -text | grep "Not "

上記を実行すると下記のような取得日、有効期限が返されてきます。

  Not Before: Jul 22 14:45:00 2017 GMT
  Not After : Oct 20 14:45:00 2017 GMT

手動更新

上記で有効期限の自動更新が不安な場合は手動更新してみてください。

/usr/local/certbot/certbot-auto renew --standalone --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx' --force-renew

Cronの自動更新設定

echo "$((${RANDOM}%60)) $((${RANDOM}%24)) * * $((${RANDOM}%7)) root /usr/local/certbot/certbot-auto renew --standalone --preferred-challenges tls-sni-01 --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx'" > /etc/cron.d/certbot-auto

参考文献

4
4
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
4
4