现在用 certbot 申请及 renew SSL 凭证十分方便, 但有时转换网域, 或者想将几个网域整合成一个凭证申请, 系统内便会储存有很多没用的旧凭证。要澈底删除这些旧凭证及它的相关档案, 可以用 certbot 的 delete 来做。
首先确认要删除的凭证, 可以检视 /etc/letsencrypt/renewal/ 目录, 那里储存了所有透过 certbot 申请的凭证:
# ls /etc/letsencrypt/renewal/
上面指令会列出所以透过 certbot 申请的凭证, 每个档案后面会加上 .conf 作结尾。
例如我以前申请了 www.phpini.com 的凭证, 现在已经没有用, 要删除可以执行以下指令:
# sudo certbot delete –cert-name www.phpini.com
执行以上指令后, certbot 便会把 www.phpini.com 的所有相关档案删除。