LoginSignup
5
2

More than 5 years have passed since last update.

Let'sEncryptでワイルドカード証明書の取得方法

Last updated at Posted at 2019-01-26

概要

Certbot Version 0.22.0よりワイルドカード証明書が取得可能になりました。
それに際し、ワイルドカード証明書の所得方法を書き残すことにしました。

検証環境

  • CentOS Linux release 7.6.1810 (Core)
  • Apache/2.4.6 (CentOS)

取得方法

最初にyumで必要なパッケージをインストールします。

yum install -y --enablerepo=epel certbot

もしCertbotが入っていてバージョンが0.22.0以前の場合はアップデートしてください。

yum update -y certbot

次にワイルドカード証明書を取得していきます。
ドメイン、メールアドレスは自分の環境に合わせて変更し、実行してください。
いろいろ聞かれると思いますがすべて了承して進めてください。

 certbot certonly --manual --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns-01 -d '*.example.com' -m yourmailaddress@example.com --agree-tos --manual-public-ip-logging-ok

実行すると以下のような文字列が表示されると思います。
表示された後にPress Enter to Continueと表示されますがまだ押さないでください。
以下の処理が終わってから押してください。(押してしまっても、もう1度実行すれば大丈夫です)

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

[英数字の文字列]

Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

上に書いてある英数字の文字列をコピーし、DNS TXTレコードに記述します
筆者はお名前ドットコムを使用していますのでお名前ドットコムのサイトに行き、ホスト名の部分を_acme-challenge、VALUEの部分を先ほどの[英数字の文字列]にしてください
キャプチャ.PNG

入力し終わったら追加し、設定してください。
設定が終わったらお名前ドットコムから変更完了のメールが届くはずです。(5分から15分ほど待ちましょう長いときは20分くらいは待つと思います)

変更完了の通知が来たらEnterキーを押しましょう。

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/example.com-0001/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/example.com-0001/privkey.pem
   Your cert will expire on 2019-04-26. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

このような文字列が出たら成功です。

このあと設定していくのですがそれは後日別の記事で書くと思います。(たぶん)
書きました => CentOS7でVirtualHostをSSL化する(Apache2.4)

設定した後にWEBブラウザで確認してみると
キャプチerwャ.PNG
このように適応されています。
今回はここまでとします。
お疲れさまでした。

参考文献

Let's Encrypt総合ポータル

最後に

初めてQiitaを投稿してみました。なにか指摘等あればコメントくださいませ

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