Let's crypt ACME泛域名证书

Let’s crypt 使用ACME为dnspod泛域名申请证书

cd ~

1
2
3
su root #否则后面没有权限重启nginx
curl https://get.acme.sh | sh -s email=chariothy@gmail.com
cd .acme.sh

(现在应该不需要了,现在换成了Zerossl) ./acme.sh --set-default-ca --server letsencrypt

export DP_Id="174377"; export DP_Key="e3a766b6fdf83a1a39dd5caea80daa25"; ./acme.sh --issue --dns dns_dp -d thy.pub -d *.thy.pub

(不能加–nginx, 因为这是http方式,目前只支持dns方式)

apt安装的nginx

1
2
3
4
5
6
acme.sh --install-cert -d thy.pub \
--key-file /etc/nginx/cert/thy.pub.key \
--fullchain-file /etc/nginx/cert/thy.pub.fullchain \
--cert-file /etc/nginx/cert/thy.pub.cert \
--ca-file /etc/nginx/cert/thy.pub.ca \
--reloadcmd "sudo systemctl force-reload nginx"

docker安装的nginx

1
2
3
4
5
6
acme.sh --install-cert -d thy.pub \
--key-file /etc/nginx/cert/thy.pub.key \
--fullchain-file /etc/nginx/cert/thy.pub.fullchain \
--cert-file /etc/nginx/cert/thy.pub.cert \
--ca-file /etc/nginx/cert/thy.pub.ca \
--reloadcmd "docker restart ng"

如果需要彻底重启

1
2
3
4
5
6
acme.sh --install-cert -d thy.pub \
--key-file /etc/nginx/cert/thy.pub.key \
--fullchain-file /etc/nginx/cert/thy.pub.fullchain \
--cert-file /etc/nginx/cert/thy.pub.cert \
--ca-file /etc/nginx/cert/thy.pub.ca \
--reloadcmd "reboot"

.acme.sh/acme.sh --upgrade --auto-upgrade