Use acme.sh to get certificate

Install from web

bash
1curl https://get.acme.sh | sh

Example for Tencent Cloud (DNSPod)

  1. click to generate secret key
  2. use this script to get cert and add hook when certificate has renewed to reload your web server
bash
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
bash
1acme.sh --set-default-ca --server letsencrypt
  • 有时候 corncob 会失败
bash
1acme.sh --cron --home ~/.acme.sh

查看日志, 类似如下内容。

bash
1[20211214日 星期二 10:56:23 CST] ===Starting cron===
2[20211214日 星期二 10:56:23 CST] Renew: 'powerfulyang.com'
3[20211214日 星期二 10:56:23 CST] Skip, Next renewal time is: 20211224日 星期五 10:23:57 UTC
4[20211214日 星期二 10:56:23 CST] Add '--force' to force to renew.
5[20211214日 星期二 10:56:23 CST] Skipped powerfulyang.com
6[20211214日 星期二 10:56:23 CST] ===End cron===