天涯海角异孤星
前几个月发表了一篇文章《申请免费的 Let's Encrypt 通配符 SSL/TLS 证书》,如今2个多月过去,今天收到了来自 Let's Encrypt 的邮件,提醒我证书该续期了。
原本以为只需要执行 certbot-auto renew
就可以愉快的完成续期,但执行报错了,输出结果如下:
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:
/etc/letsencrypt/live/yangdx.com/fullchain.pem (failure)
重点这句:An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.
原来,通配符域名证书不能简单的通过执行 certbot-auto renew
来完成续期,必须通过 --manual-auth-hook
参数提供一个身份验证脚本来自动完成 DNS TXT 记录的验证操作。
Let's Encrypt 是免费、开放和自动化的证书颁发机构。由非盈利组织互联网安全研究小组(ISRG)运营。Let's Encrypt 提供的是域名验证型(DV)证书,有效期为 90 天,证书快到期时可以通过脚本自动续期。中文官网是 https://letsencrypt.org/zh-cn/。
以往我们申请 SSL 证书,通常是在 IDC 服务商的管理后台页面填写表单进行申请,而 Let's Encrypt 则是通过命令行提交申请,操作也很简单。Let's Encrypt 使用 ACME 协议来验证您对给定域名的控制权并向您颁发证书,最常用的是就是 ACME 客户端软件是 Certbot。
js 的 includes 方法是 ES6 标准才增加的。includes 与 indexOf 类似,用于查找,传统的 indexOf 返回的是数字下标,而 includes 返回的是布尔值。
关于 includes 的具体用法见:
1、字符串中 includes 的用法
2、数组中 includes 的用法
微信小程序中 js 数组的 includes 在一些老机型如 iOS8上并不支持,详见:小程序 JavaScript 支持情况。如果要适配老机型的话,还是用 indexOf 吧。