Let’s Encryptの証明書更新失敗
Contents
Certbot renew失敗
朝Cronからのメールを見ると・・・証明書の更新に失敗している。
1 renew failure(s), 0 parse failure(s)
IMPORTANT NOTES:
– The following errors were reported by the server:Domain: www.b-twin.net
Type: unauthorized
Detail: Invalid response from
googleで情報を探してみると…1年前にTLS-ALPN-01認証方法の脆弱性が見つかって2月13日でその認証方式が終了したそうな・・・更新日が2月15日だからアウトになったのね。
認証法としてHTTP-01ドメイン認証を使えということらしい。つまり、http://www.b-twin.net/.well-known/acme-challengeの下をhttpのポート80番で読み出しできるようにすれば良い。
mod_rewriteのルールに追加する。
1 2 3 |
RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
Certbotのドライランでテストをやってみる。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# certbot renew --dry-run Saving debug log to /var/log/letsencrypt/letsencrypt.log - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Processing /***/***/***/letsencrypt/renewal/www.b-twin.net.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cert not due for renewal, but simulating renewal for dry run Plugins selected: Authenticator webroot, Installer None Renewing an existing certificate Performing the following challenges: http-01 challenge for www.b-twin.net Waiting for verification... Cleaning up challenges - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - new certificate deployed without reload, fullchain is /***/***/***/letsencrypt/live/www.b-twin.net/fullchain.pem - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ** DRY RUN: simulating 'certbot renew' close to cert expiry ** (The test certificates below have not been saved.) Congratulations, all renewals succeeded. The following certs have been renewed: /***/***/***/letsencrypt/live/www.b-twin.net/fullchain.pem (success) ** DRY RUN: simulating 'certbot renew' close to cert expiry ** (The test certificates above have not been saved.) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
となり、無事成功した。
その後手動で更新を実施し、無事更新を確認。
新しい認証方式が出るらしいのでしばらくは要Watchだな。