允许加密的多个子域

Bre*_*ith 11 ssl-certificate lets-encrypt

我有一条有吸引力的消息,表明我很遗憾无法为多个子域生成证书:

Wildcard domains are not supported: *.mynewsiteweb.com
Run Code Online (Sandbox Code Playgroud)

另一方面,可以为每个子域逐个生成它.

有更好的解决方案吗?谢谢 :)




编辑

现在Certbot支持通配符,因为0.22.0版本( 2018-03-07 )

链接

谢谢

Jah*_*hid 9

遗憾的是,无法为多个子域生成证书

不对.这可能产生多个子域的证书.只需在配置文件中按名称包含这些子域:

domains = example.org, www.example.org, sub.example.org, www.sub.example.org
Run Code Online (Sandbox Code Playgroud)

然后使用配置文件运行certbot:

certbot-auto -c config.ini
Run Code Online (Sandbox Code Playgroud)

您必须验证每个域的所有权.

详细了解配置文件.


小智 7

在支持通配符之前,我发现有必要在表单中的证书上明确列出每个域

… -d example.com -d www.example.com -d blog.example.com -d www.blog.example.com …
Run Code Online (Sandbox Code Playgroud)

(由于我使用的重定向域的奇怪混合中的复杂性与--webroot身份验证一起使用效果最好).

感谢Trojan的解释和文档:

https://certbot.eff.org/docs/install.html?highlight=wildcard

我能够生成现在正在使用的通配符证书.不幸的是,还没有EasyDNS.com的插件,所以我不得不进行手动验证(Trojans示例保存当天).通过这种方法,我能够在表单中生成证书

… -d *.example.com -d example.com -d *.blog.example.com …
Run Code Online (Sandbox Code Playgroud)

由于(例如,为了这个缘故)blog.example.com已经被*.example.com通配符覆盖,我只需要为*.blog.example.com添加通配符.事实上,certbot不允许冗余(如果我试图包括*.example.com和www.example.com,则会抱怨).

此处列出了当前可用的插件:

https://certbot.eff.org/docs/using.html#dns-plugins

在撰写本文时,他们包括以下DNS提供商:

  • certbot-DNS-的CloudFlare
  • certbot-DNS-cloudxns
  • certbot-DNS-digitalocean
  • certbot-DNS-dnsimple
  • certbot-DNS-dnsmadeeasy
  • certbot-DNS-谷歌
  • certbot-DNS-luadns
  • certbot-DNS-nsone
  • certbot-DNS-RFC2136
  • certbot-DNS-route53

也许我会在周末看一看,看看为我自己的DNS提供商编写一个插件有多难.


Chr*_*uey 6

我刚刚完成了为多个子域生成单个Let的加密证书的过程.我遇到并解决了一些小问题.我在下面的链接中发布了一篇简短的文章,解释了我在Apache Web服务器上安装Let's Encrypt数字证书时获得的原因,该服务器提供对多个子域的HTTP和HTTPS访问.

我最重要的"经验教训"是,您需要为HTTP访问创建VirtualHost,并为每个可通过HTTPS访问的子域创建VirtualHost. 重要信息:必须在单个配置文件中指定每个VirtualHost定义.如果在单个配置文件中定义了多个VirtualHost,则Let's Encrypt certbot将无法正常运行.我在下面三(3)个不同的配置文件中定义了三(3)个VirtualHosts.dummy.conf文件在Apache中没有任何功能用途(即,它不会导致不必要的999侦听端口),但是由Let的加密证书机制成功生成数字证书是绝对必要的.

Web服务器配置文件

然后,您可以运行以下命令来生成证书:

certbot certonly -d example.com -d www.example.com
Run Code Online (Sandbox Code Playgroud)

https://www.hueyise.com/index.php/letsencrypt

  • @ChrisHuey欢迎来到SO.这看起来是一个很好的答案,但可以通过将重点复制到答案中来改进.这有助于防止链接损坏,因此即使站点关闭,答案仍然很好.尽管如此,仍然可以将链接保留为原始来源!:) (2认同)

tro*_*jan 5

certbot现在支持通配域(从0.22版开始)

域必须通过DNS验证(您必须将_acme-challenge.yourdomain.tld TXT记录添加  到具有随机生成值的DNS条目中)

例:

certbot-auto --server https://acme-v02.api.letsencrypt.org/directory -d *.example.pl --manual --preferred-challenges dns-01 certonly
Run Code Online (Sandbox Code Playgroud)