Let's Encryptサーバー証明書を削除する
サブドメイン名変更により、
サブドメインのサーバー証明書を削除しなければならなくなりました。
本記事は、その時の記録です。
サーバー証明書は、下に示すよう”certbot revoke”コマンドで削除することができます。
|
1 |
# certbot revoke --cert-name=subdomain.example.com |
”certbot revoke”コマンドでサーバー証明書を削除すれば、
手動削除の時のように、削除漏れがでてくるようなことがありません。
サーバーに残っている旧バージョンのものも削除してくれます。
参考として、下にサーバー証明書を削除した時のログを示します。
|
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 29 30 |
root@hoge-????:/etc# ls /etc/letsencrypt/live/ README example.com subdomain.example.com root@hoge-????:/etc# certbot revoke --cert-name=subdomain.example.com Saving debug log to /var/log/letsencrypt/letsencrypt.log - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you like to delete the certificate(s) you just revoked, along with all earlier and later versions of the certificate? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es (recommended)/(N)o: Y - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The following certificate(s) are selected for deletion: * subdomain.example.com WARNING: Before continuing, ensure that the listed certificates are not being used by any installed server software (e.g. Apache, nginx, mail servers). Deleting a certificate that is still being used will cause the server software to stop working. See https://certbot.org/deleting-certs for information on deleting certificates safely. Are you sure you want to delete the above certificate(s)? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y Deleted all files relating to certificate subdomain.example.com. Congratulations! You have successfully revoked the certificate that was located at /etc/letsencrypt/live/subdomain.example.com/cert.pem. root@hoge-????:/etc# ls /etc/letsencrypt/live/ README example.com root@hoge-????:/etc# |
なお、この件で使用したcertbotは、
Snap版certbotで、
サーバー証明書の自動更新はSnapのサービス管理にフックしています。
cronへ”certbot renew”の登録は行っていないので、削除の必要がありません。
【参考】Snap版Let's Encrypt
RHEL 10では、単純なインストールではcertbotによる証明書の発行はできませんでした。
Snap
を介してのインストールでなければダメなようです。
RHEL 10におけるSnap版Let's Encryptのインストールについては、
次のページをご覧いただければと思います。
【Let's Encrypt】RHEL 10 + Apache 2.4にLet’s Encryptをインストールする(2025年11月Snap版)
以上
本文中の記述に、
誤字や脱字、誤った内容の記述など見つかりましたら、
下に示すフォームでご連絡いただければ幸いです。

コメント