Use acme.sh to get certificate
Published by powerfulyang on Dec 13, 2021
Install from web
1curl https://get.acme.sh | sh
Example for Tencent Cloud (DNSPod)
- click to generate secret key
- use this script to get cert and add hook when certificate has renewed to reload your web server
1export DP_Id="1234" // get from https://console.dnspod.cn/account/token
2export DP_Key="sADDsdasdgdsf"
3acme.sh --issue --dns dns_dp -d example.com \n
4 -d *.example.com --renew-hook "command to reload your web server"
一些相关的小事情
acme.sh 默认 CA 切换到 ZoreSSL
改回到Let's Encrypt
1acme.sh --set-default-ca --server letsencrypt
有时候 corncob 会失败
1acme.sh --cron --home ~/.acme.sh
查看日志, 类似如下内容。
1[2021年 12月 14日 星期二 10:56:23 CST] ===Starting cron===
2[2021年 12月 14日 星期二 10:56:23 CST] Renew: 'powerfulyang.com'
3[2021年 12月 14日 星期二 10:56:23 CST] Skip, Next renewal time is: 2021年 12月 24日 星期五 10:23:57 UTC
4[2021年 12月 14日 星期二 10:56:23 CST] Add '--force' to force to renew.
5[2021年 12月 14日 星期二 10:56:23 CST] Skipped powerfulyang.com
6[2021年 12月 14日 星期二 10:56:23 CST] ===End cron===