4
5

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 のDNS-01認証で作成した証明書の手動での更新方法

Last updated at Posted at 2020-06-05

背景

特定場所からのみ接続が許可されている開発サーバーに対して Let's Encrypt による証明書の発行を行いたい。
発行・更新には DNS-01 というDNSレコードにトークンを埋め込むことで発行者側に正しく設定できていることを伝える方法があるのでこれを使う。
大抵調べても詳細を忘れるのでメモ。

コマンド

ドメインが www.example.com の場合。
これで対話式の手作業でDNSの更新・新規登録作業が行える。

sudo certbot certonly --manual -d www.example.com --preferred-challenges dns

証明書を更新した後は、nginx/apache などの再起動をお忘れなく。

補足

renew コマンドで(自動化した)証明書の更新を行う場合、DNSレコードの値を設定・削除できる必要がある。
この場合、 --manual-auth-hook で指定したスクリプトで DNS に値を設定し、--manual-cleanup-hook で指定したスクリプトで不要なレコードを削除する。

参考(というか答え)

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?