acme.sh可以一个免费的生产网站证书的脚本非常好用,github地址是:https://github.com/acmesh-official/acme.sh
先安装acme.sh工具:
git clone https://github.com/acmesh-official/acme.sh.git
cd./acme.sh
./acme.sh --install -m my@example.com
以dnspod为例,分为三个步骤:
1.登录到DNS托管页面找到对应一下信息:
export DP_Id=45xxx
export DP_Key="2ce795cd63xxxx"
2.执行发行通配符证书命令:
acme.sh --issue --dns dns_dp -d xxx.com -d '*.xxx.com'
申请指定证书秘钥长度类型,例如RSA2048
acme.sh --issue --dns dns_dp -d xxx.com -d '*.xxx.com' -k 2048
3.在本机目录下/root/.acme.sh/xxx.com_ecc找到新申请的证书
4.后期如果需要更新证书并重新生成只需要一条命令:
acme.sh --renew -d .com --force