acme.sh & cloudflare

内容纲要

官方资料

脚本安装&使用
DNS API用法

安装acme.sh脚本

curl https://get.acme.sh | sh -s [email protected] && source ~/.bashrc

修改ca服务器

acme.sh --set-default-ca --server letsencrypt

设置环境变量

export CF_Token="API KEY"
export CF_Account_ID="账户ID"

申请证书

假如域名为a.aa,申请a.aa域名的泛域名证书

acme.sh --issue --dns dns_cf -d a.aa -d '*.a.aa'

安装证书

acme.sh --install-cert -d a.aa \
--key-file       /home/certs/证书名.key \
--fullchain-file  /home/certs/证书名.crt \
--reloadcmd     "重启服务或重载配置命令"