安装

curl https://get.acme.sh | sh
wget -O - https://get.acme.sh | sh
#查看acme版本
acme.sh —version

申请

新版本

注意:从 acme.sh v3.0.0 开始,acme.sh 使用 Zerossl 作为默认 ca,您必须先(一次)注册该帐户,然后才能颁发新证书。
使用电子邮件地址注册您的帐户:
acme.sh —register-account -m myemail@example.com —server zerossl

如果您已经在 www.zerossl.com 上有一个帐户, 您还可以使用外部帐户绑定 (EAB) 凭据注册您的 acme 帐户。
在以下位置生成您的 EAB 凭据:https://app.zerossl.com/developer
acme.sh —register-account —server zerossl —eab-kid xxxxxxxxxxxx —eab-hmac-key xxxxxxxxx

使用 Zerossl.com申请证书

  1. #阿里云
  2. export Ali_Key=""
  3. export Ali_Secret=""
  4. #申请证书
  5. acme.sh --server zerossl --issue --dns dns_ali -d domain.com -d *.domain.com

老版本

  1. #阿里云
  2. export Ali_Key=""
  3. export Ali_Secret=""
  4. #申请证书
  5. acme.sh --issue --dns dns_ali -d domain.com -d *.domain.com

其他

自动拷贝证书
acme.sh —installcert -d domain.com —key-file /data/ssl/domain.com/domain.com.key —fullchain-file /data/ssl/domain.com/fullchain.cer —reloadcmd “sudo /usr/local/nginx/sbin/nginx -s reload”
acme.sh —installcert -d domain.com —key-file /data/ssl/domain.com/domain.com.key —fullchain-file /data/ssl/domain.com/fullchain.cer —reloadcmd “systemctl restart nginx.service”

更新证书
acme.sh —renew -d ‘*.domain.com’ —force

查看证书列表
acme.sh —list

删除证书
acme.sh remove
acme.sh —revoke -d example.com

升级 acme.sh
acme.sh —upgrade
#开启自动升级
acme.sh —upgrade —auto-upgrade
#关闭自动更新
acme.sh —upgrade —auto-upgrade 0