【Let’s Encrypt】証明書更新に「unrecognized arguments: –manual-public-ip-logging-ok」とエラーが出て失敗する

AlmaLinux9
このサイトはアフィリエイト広告(Amazonアソシエイト含む)を掲載しています。

当環境ではCertbotを使用して証明書を発行しており、3か月に一度手動でスクリプトを実行して証明書の更新作業を実施しています

更新の際はすでに作成済のスクリプトを毎回実行していたのですが、今回全く同じスクリプトを使用しているにも関わらずエラーがでて更新ができませんでした

原因と対策を調べまして、スクリプトを一部変更することで無事更新できましたので記載いたします

エラー内容

実行したスクリプトの内容です
DNS-01チャレンジという認証を使って、ワイルドカードが含まれる証明書を取得して、Apacheを再起動するという内容です

#!/bin/sh
certbot certonly --manual -d xxxxxxxxxx.com -d *.xxxxxxxxxx.com -m xxxxxxxxxx@xxxxxxxxxx.com --agree-tos --manual-public-ip-logging-ok --preferred-challenges dns-01; systemctl restart lshttpd.service

実行して出たエラーはこちらです

# sh certbot.sh
usage:
  certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...

Certbot can obtain and install HTTPS/TLS/SSL certificates.  By default,
it will attempt to use a webserver both for obtaining and installing the
certificate.
certbot: error: unrecognized arguments: --manual-public-ip-logging-ok

ここで表示されている「certbot: error: unrecognized arguments: –manual-public-ip-logging-ok」というエラーが怪しそうなので詳しく調べてみることにしました

原因

Certbot 3.0.0から、–manual-public-ip-logging-okコマンドが非対応になったためだそうです

Certbot 3.0.0 Release!
These lines are confusing to me: the biggest changes involve moving from the recently EOL'd Python 3.8 to 3.12 Support f...

3.0.0 – メイン
変更

  • コマンドラインフラグが削除されました。--manual-public-ip-logging-ok

当環境のCertbotバージョンを確認してみたところ「3.1.0」だったので該当していました

# certbot --version
certbot 3.1.0

対策

該当のコマンドをスクリプト内から削除して再度実行することで更新できました

#!/bin/sh
certbot certonly --manual -d xxxxxxxxxx.com -d *.xxxxxxxxxx.com -m xxxxxxxxxx@xxxxxxxxxx.com --agree-tos  --preferred-challenges dns-01; systemctl restart lshttpd.service

まとめ

今まで問題がないスクリプトでいきなりエラーが出てしまった上、証明書の有効期限も迫っていたので焦りましたが、無事発行出来てよかったです

Let’s Encryptは無料で非営利団体が運営しているため、今回のような突然の仕様変更や運用の将来性が不安な面があります

企業でSSL証明書を使用している場合には、運用の安定性や信頼性向上のために下記のような有料SSLを検討しても良いかもしれません

サイトシール(認証マークのようなもの)も発行されますので、視覚的にサイトの安全性を示すことも可能になります

\今ならセール中!/

コメント

タイトルとURLをコピーしました