猫言猫语

严以律己·宽以待人·自强不息·知行合一

使用 acme.sh 申请 https 证书

| 使用 acme.sh 申请 https 证书已关闭评论

一、安装 acme.sh

curl https://get.acme.sh | sh -s email=admin@domain.com

二、手动模式创建

acme.sh --issue --dns -d yourdomain.com \
    --yes-I-know-dns-manual-mode-enough-go-ahead-please

根据提示创建相应的 TXT 记录,再执行

acme.sh --renew -d yourdomain.com \
    --yes-I-know-dns-manual-mode-enough-go-ahead-please

三、DNS模式创建

如果DNS服务器支持API,可以与acme.sh对接,一步完成,以 CLOUDFLARE 为例,如果直接使用 Global API Key,则使用命令:

export CF_Key=00000000000000000000000000000000
acme.sh --issue --dns dns_cf -d yourdomain.com

如果使用首先的 API 权限,则使用命令:

export CF_Token=00000000000000000000000000000000
acme.sh --issue --dns dns_cf -d yourdomain.com

四、更换签发服务器

当前版本的 acme.sh 默认使用的是 zerossl 作为证书签发服务器,如果你想更换为 letsencrypt,可以使用 server 参数来实现:

acme.sh --issue --dns dns_cf -d yourdomain.com --server letsencrypt

评论已关闭。