1. 程式人生 > >certbot-auto報錯怎麼辦?免費ssl證書自動續期報錯。

certbot-auto報錯怎麼辦?免費ssl證書自動續期報錯。

Let’s Encrypt頒發的萬用字元證書每次續期需要驗證一下DNS的TXT記錄,這個TXT記錄的值是會發生變化的。所以續期時候需要更改下DNS的TXT記錄。網上流傳的都是php版本的指令碼。還要寫shell+php,挺麻煩的。這裡我自己用go寫了一個更新DNS記錄的小程式

The error was: PluginError(‘An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.’,). Skipping.
All renewal attempts failed. The following certs could not be renewed:

  1. 先配置兩個環境變數,最好寫在/etc/profile,或者.bashrc裡面,然後執行source生效
# 阿里雲的access key和secret
export CERTBOT_ALI_KEY=""
export CERTBOT_ALI_SECRET=""
  1. 下載certbot-alidns放到/usr/bin/就可以了。
# 用法
certbot-auto renew --cert-name shuaibo.wang --manual-auth-hook /usr/bin/certbot-alidns
  1. 重新載入下ssl證書
nginx -s reload

certbot-alidns下載
在這裡插入圖片描述