我已经通过带有 DNS 插件的 certbot 成功设置了 SSL 证书。这很好用,我已经为 example.com 和 *.example.com 颁发了证书:
certbot certificates
输出:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
Certificate Name: example.com
Domains: example.com *.example.com
Expiry Date: 2022-02-28 11:09:56+00:00 (VALID: 89 days)
Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
到目前为止一切顺利,所有域似乎都得到了正确保护:
example.com = OK
test.example.com = OK
但是,问题从 domain 开始test1.test.example.com
。浏览器不断抱怨域不安全的事实..!我已经重新签发了 SSL 证书。这成功了,但域仍被标记为不安全。
需要注意的是,如果我修改Apache
域的配置以不将http (insecure)
流量重定向到https (secure)
流量,我可以访问该站点。这验证了我的 apache 设置,实际上只有 1 个配置文件,允许:
ServerName example.com
ServerAlias *.example.com
编辑:也许这有帮助。Safari 告诉我证书名称example.com
与输入不匹配?火狐返回SSL_ERROR_BAD_CERT_DOMAIN
. 因此,我尝试将域更新为也允许*.*.example.com
,但是 certbot 不允许这样做,因为它返回:Cannot issue for '*.*.example.com': Domain name has more than one wildcard
编辑 2:DNS 插件生成了一个 json 文件,其中包含验证域的身份验证信息。该文件包含一个条目fulldomain
和subdomain
,但问题在于two level 'sub-sub' domain
? 也许这就是问题所在?我该如何解决这个问题,因为 certbot 插件不允许多通配符域?