Home SSL免费证书申请和续期
Post
Cancel

SSL免费证书申请和续期

安装 acme.sh

curl https://get.acme.sh | sh -s email=nhsoft.lsd@gmail.com

使配置生效

source ~/.bashrc

或者

source ~/.acme.sh/acme.sh.env

申请腾讯云子账号,只开通 QcloudDNSPodFullAccess 权限,创建API Key

export Tencent_SecretId=”AKIXXXX4” export Tencent_SecretKey=”AAyXXXXXm”

腾讯云申请通配符SSL

~/.acme.sh/acme.sh –issue –dns dns_tencent
-d himelon.com
-d ‘*.himelon.com’
–debug 2 2>&1 | tee ~/acme-debug.log

阿里云 DNS

~/.acme.sh/acme.sh –issue –dns dns_ali
-d himelon.com
-d *.himelon.com

Cloudflare DNS

~/.acme.sh/acme.sh –issue –dns dns_cf
-d himelon.com
-d *.himelon.com

GoDaddy DNS

~/.acme.sh/acme.sh –issue –dns dns_gd
-d himelon.com
-d *.himelon.com

成功后会输出

证书: /Users/{username}/.acme.sh/a.com_ecc/himelon.com.cer 私钥: /Users/{username}/.acme.sh/a.com_ecc/himelon.com.key 中间证书: /Users/{username}/.acme.sh/a.com_ecc/ca.cer 完整链: /Users/{username}/.acme.sh/a.com_ecc/fullchain.cer

acme.sh 已自动添加 cron 任务,查看

crontab -l | grep acme

输出类似:

0 0 * * * “/root/.acme.sh”/acme.sh –cron –home “/root/.acme.sh” > /dev/null

手动测试续期(不会真正续期)

acme.sh –renew -d himelon.com –force

查看正式到期时间

openssl x509 -in /root/.acme.sh/himelon.com_ecc/fullchain.cer -noout -enddate

This post is licensed under CC BY 4.0 by the author.