如何从让我们加密获取多域通配符 ssl?

lig*_*per 1 ssl-certificate lets-encrypt

我有一个响应域的服务器,例如a.b.c.example.com. a b并且c 是动态部分,我想用一个 SSL 证书覆盖它们。

我在这里*.example.com. 但现在我有错误ERR_CERT_COMMON_NAME_INVALID

同时c.example.com运作良好。

我可以以某种方式为多个嵌套子域颁发证书吗?

Jen*_*y D 5

不,你不能那样做。根据RFC 2828,SSL 证书通配符可用于匹配单个域名组件,而不是多个组件。这已在RFC 6125 中进行了修订和进一步澄清,其中第 5.2 节指出:

   o  The ’*’ (ASCII 42) wildcard character is allowed in the dNSName of
      the subjectAltName extension (and in common name, if used to store
      the host name), but only as the left-most (least significant) DNS
      label in that value.  This wildcard matches any left-most DNS
      label in the server name.  That is, the subject *.example.com
      matches the server names a.example.com and b.example.com, but does
      not match example.com or a.b.example.com.  Implementations MUST
      support wildcards in certificates as specified above, but MAY
      provide a configuration option to disable them.
Run Code Online (Sandbox Code Playgroud)

换句话说,不允许使用多个通配符,并且任何通配符都必须位于 DNS 名称的最左侧部分。这在第 6.4.3 节中重复,指定客户端在遇到包含通配符的证书时应如何处理 - 除域名最左侧部分之外的任何通配符都应导致证书与您使用的域名不匹配为了。具体来说,6.4.3的第一点是:

   1.  The client SHOULD NOT attempt to match a presented identifier in
       which the wildcard character comprises a label other than the
       left-most label (e.g., do not match bar.*.example.net).
Run Code Online (Sandbox Code Playgroud)

因此,即使您可以让 Letsencrypt 制作这些证书,您网站的访问者仍然不会接受它们。