5
6

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 5 years have passed since last update.

Let's Encryptがワイルドカード証明書(ACMEv2)に対応したので使ってみた

Posted at

はじめに

ACMEv2対応のアナウンスが来ていたので実験してみました。

Let's Encryptで以前の形式(ACMEv1)の証明書を取得・設定する方法はこちらの投稿を参考にしてください。

証明書の発行

前回の記事と同じく certbot を使い、以下のコマンドを使って証明書を発行しました。
v1の時と違いDNS TXTレコードを使ったACME認証が必要になりますので、設定中にDNSレコードを書き換える必要があります。

コマンド
certbot certonly --agree-tos --manual-public-ip-logging-ok --manual -d [ドメイン名] --preferred-challenges dns-01 --email [管理者のメールアドレス] --server https://acme-v02.api.letsencrypt.org/directory
実行例
certbot certonly --agree-tos --manual-public-ip-logging-ok --manual -d "*.yourdomain.jp" --preferred-challenges dns-01 --email admin@yourdomain.jp --server https://acme-v02.api.letsencrypt.org/directory
  • --manual-public-ip-logging-okオプションを使ってIPロギングを承認します。
  • --preferred-challenges dns-01オプションを使ってDNS TXTレコード認証を承認します。
  • --serverオプションでACMEv2に対応したエンドポイントを設定してください。
  • ドメイン名の箇所は「"*.yourdomain.jp"」のようにワイルドカードをつけダブルクオートで囲みます。

途中で以下のようなメッセージが表示されます。
指示に従いTXTレコードを設定してからENTERキーを押下します。
このレコード値はコマンド実行のたびにランダムな文字列が表示されます。
※DNS未波及等でコマンドが失敗する場合があるので、TXTレコードのTTLを短めに設定しておく方がよいです。

-------------------------------------------------------------------------------
Please deploy a DNS TXT record under the name
_acme-challenge.yourdomain.jp with the following value:

WFek9KSKZ2Hv7tVIHtmC3l41pdx36xOIglWOufYq_iw

Before continuing, verify the record is deployed.
-------------------------------------------------------------------------------
Press Enter to Continue

ENTER押下後にDNSレコードが確認され、問題なければv1と同じファイル構成の証明書が発行されます。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?