acme.sh使用
利用 Let’s Encrypt 的 ACME 协议在服务器上申请、管理 SSL 证书
下载安装
curl https://get.acme.sh | sh
验证
http (需要在网站根目录下放置一个文件, 来验证你的域名所有权, 完成验证)
acme.sh --issue -d mydomain.com -d www.mydomain.com --webroot /home/wwwroot/mydomain.com/
apache
acme.sh --issue -d mydomain.com --apache
nginx
acme.sh --issue -d mydomain.com --nginx
无服务器,临时监听80端口,生成证书
acme.sh --issue -d mydomain.com --standalone
DNS(域名上添加txt解析记录, 验证域名所有权)
acme.sh --issue --dns -d mydomain.com
acme.sh 目前支持 cloudflare, dnspod, cloudxns, godaddy 以及 ovh 等数十种解析商提供的 api 自动添加 txt 记录完成验证
export DP_Id="1234" export DP_Key="sADDsdasdgdsf" acme.sh --issue --dns dns_dp -d mydomain.com -d www.mydomain.com
安装证书
默认生成的证书都放在安装目录下: ~/.acme.sh/
acme.sh --installcert -d mydomain.com \ --key-file /etc/nginx/ssl/mydomain.key \ --fullchain-file /etc/nginx/ssl/mydonain.cer \ --reloadcmd "service nginx force-reload"
更新acme.sh
#手动升级 acme.sh --upgrade #自动升级 acme.sh --upgrade --auto-upgrade #关闭自动升级 acme.sh --upgrade --auto-upgrade 0