Let’s EncriptのSSL証明書自動更新でこけた話

どうも、サバサバの鯖缶です。

以前に管理してたドメインの証明書が期限が迫ってきたある日、アラートに「証明書自動更新できてねぇぞこんにゃろー(# ゚Д゚)!」的な内容が来ててΣ(・ω・ノ)ノ!

慌ててcrontabで確認、該当自動更新シェルをbash -xでエラーを再現すると・・・(; ・`д・´)むむっ、これは



Attempting to renew cert ({ドメイン名}) from /etc/letsencrypt/renewal/{ドメイン名}.conf produced an unexpected error: The manual plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.',). Skipping.

All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/{ドメイン名}/fullchain.pem (failure)

なんだ、The manual plugin is not working; there may be problems with your existing configuration.ってことはAuthenticator manualプラグインとやらをやっつければいいってか?

グーグルしぇんしぇー教えて!グーグルちゃんに教えてもらったこのリンクをたどると、

https://community.letsencrypt.org/t/certbot-manual-renew/17789

Authenticator manualを更新しとけよ、ってよ。

あいよ分かった、下記のコマンドでただくと、マニュアル更新の手順に入る。



certbot certonly --manual -d {ドメイン名}

証明書にサインして欲しけりゃおまんとこのIPアドレスを公に晒してもええか?ええで~晒しちゃえ!(*ノωノ)



Create a file containing just this data:

{認証コード}

make it available on your web server at this URL:

http://{ドメイン名}/.well-known/acme-challenge/{認証ファイル名}

合言葉が入ったファイルを上記のURLで見れるようにする為に、公開ディレクトリー配下に所定のフォルダーを作って、そこに認証コードをコピって貼ったファイルを配置できたら、Enterキー押下。

やっちゃえバーサーカーw



Waiting for verification...
Cleaning up challengesIMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/{ドメイン名}/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/{ドメイン名}/privkey.pem
Your cert will expire on {賞味期限}. To obtain a new or tweaked
version of this certificate in the future, simply run certbot-auto
again. To non-interactively renew *all* of your certificates, run
"certbot-auto renew"

おめでとう!成功したやで!8888888

学爾時習之、不亦悦乎? 有朋自遠方来、不亦楽乎? 人不知爾不愠、不亦君子乎?

シェアする

コメントを残す

コメントする

CAPTCHAis initialing...