SSブログ

Let's Encryptの自動更新見直し (2021/03/24) [OpenBSD]

うちのドメインはLet's Encryptにサーバ証明書を発行してもらっていますが、当初勝手が分からずStandalone方式を設定してしまっています。この方式の場合、証明書の更新の度にWebサーバを終了させてなければなりません。ちょっとこれは面倒です。せっかくなのでWebroot方式に変更することにします。

一応、私のLet's Encrypt(ACME)に関する理解は以下の通りです。基本的に自分のサーバの身の証を立てる(インターネット上に存在していることを示す)ための方式が2つあり、それぞれ

Standalone方式:一時的なテンポラリサーバをTCP/80で待ち受け、外部(Let's Encrypt)からのアクセスによって身の証を立てる方法。そのためWebサーバが動作中だとListenポートが競合する。

Webroot方式:Webサーバが既に動作中あることを前提に、Webサーバ上のWebページを一時的に間借りする方法。(外部からアクセスできるWebページを一時生成して認証に使う)

なお、Let's Encryptにおける証明書の発行・更新は1時間に5回までに制限されていますので、失敗を前提に何度もリトライするのであれば「--dry-run 」オプションを付けておきましょう。

私は以下のページなどを参考にさせて頂きました。
https://qiita.com/tmatsumot/items/aca49d99558d2646ef36

/etc/letsencrypt/配下を一旦綺麗に掃除し、以下のコマンドで一発でした。
openbsd# certbot certonly --agree-tos --webroot -w /var/www/htdocs/ -d xxx.xxxxx.xxx -m xxxxx@xxxxxx.xxx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

-dで自分のFQDN(https://xxxxxxx/の、xxxxxxxとなる部分)を指定し、-mでメールアドレスを指定します。

約3ヶ月後、Webroot方式での更新もチャレンジしてみます。



タグ:Let's Encrypt
nice!(0)  コメント(0) 
共通テーマ:日記・雑感

nice! 0

コメント 0

コメントを書く

お名前:
URL:
コメント:
画像認証:
下の画像に表示されている文字を入力してください。