3
8

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.

Letsencryptでワイルドカード証明書取得(Ubuntu 16.04.4 LTS)

Posted at

Letsencryptでワイルドカード証明書取得(Ubuntu 16.04.4 LTS)

解説なしのメモです

レポジトリの追加

Ubuntu 16.04.4 LTSはletsencryptパッケージがありますが、ワイルドカード証明書には対応していませんので、対応している物を導入します。幸いレポジトリがあるようで楽できるぞと追加します。Certbot0.22以上が必要。

sudo add-apt-repository ppa:certbot/certbot

アップデート

sudo apt update

インストール

sudo apt install certbot

証明書の取得

証明書の取得コマンドです「-d」に「*.ドメイン」でワイルドカードを指定します。--serverにacme v02が使えるサーバを指定します。

$ sudo certbot certonly --manual -d *.mphosato.com --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory

TXTレコードの設定

ワイルドカード証明書取得のプロセスでは指定のFQDNにTXTレコードを付与することで認証します。証明書の取得コマンドの出力に以下のように出ます。

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

aprhgVTKZOJTe85yRqqe1XJFF3eN6fZUQjLyQYN8YDk

Before continuing, verify the record is deployed.

「_acme-challenge.mphosato.com」のTXTレコードに「aprhgVTKZOJTe85yRqqe1XJFF3eN6fZUQjLyQYN8YDk」を設定して反映された頃を見てエンターを押すと進みます。

次のように**Congratulations!**と出たら取得できました。

Press Enter to Continue
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/mphosato.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/mphosato.com/privkey.pem
   Your cert will expire on 2018-08-17. 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"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - 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

3
8
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
3
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?