CertBot搭配DNSPod

CertBot搭配DNSPod

summary: cetbot搭配dnspod实现自动注册ssl证书和自动续期

1.安装pip、venv、新建certbot虚拟环境并激活

apt install python3-pip
apt install python3.11-venv
python3 -m venv certbot-env
source certbot-env/bin/activate

2. pip安装certbot

  • 虚拟环境内安装certbot,pip安装的优点为版本是最新的,(使用豆瓣源)
pip3 install certbot -i https://pypi.doubanio.com/simple/

3.安装DNSPod扩展

https://github.com/tengattack/certbot-dns-dnspod

pip install git+https://github.com/tengattack/certbot-dns-dnspod.git
  • (optional)如若提示缺失zope
pip install zope.interface -i https://pypi.doubanio.com/simple/

4.certbot-dns-dnspod 配置文件

编辑dnspod的配置ini文件

dns_dnspod_api_id = 12345
dns_dnspod_api_token = 1234567890abcdef1234567890abcdef

5.certbot搭配插件使用

certbot certonly -a dns-dnspod \
  --dns-dnspod-credentials /etc/letsencrypt/dnspod.ini \
  -d example.com \
  -d *.example.com

6.Certbot 常用管理命令

  • 查看certbot当前管理的证书
certbot certificates 
  • 续期
certbot renew
posted @ 2024-08-11 14:28  长怜  阅读(319)  评论(0)    收藏  举报