使用带有 aws 负载均衡器的路由 53 的顶级域的 SSL 验证失败

Nis*_*han 2 ssl amazon-ec2 amazon-web-services

Secure Connection Failed

An error occurred during a connection to domain.com. PR_END_OF_FILE_ERROR

    The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
    Please contact the web site owners to inform them of this problem.
Run Code Online (Sandbox Code Playgroud)

我仅在根域中收到此错误。我的子域运行良好。我的 ssl 证书适用于*.domain.com,我尝试使用domain.comssl 证书,但这使我在子域和根域上的连接不安全。

重新加载 3 次后,该网站会在 Brave 和 Chrome 浏览器上加载。最初的 2 次点击给出了相同的错误。这在 Firefox 上给出了一致的错误。

小智 5

如果您阅读 AWS ACM 的文档(您可能将其与 AWS 负载均衡器一起使用),您将发现以下内容:

当您申请通配符证书时,星号(*)必须位于域名的最左边,并且只能保护一级子域名。例如,*.example.com 可以保护 login.example.com 和 test.example.com,但不能保护 test.login.example.com。另请注意,*.example.com 仅保护 example.com 的子域,它不保护裸域或顶级域 (example.com)。要保护两者,请参阅下一步。

因此,在这种情况下,您可以保护*.domain.comdomain.com不属于该通配符的一部分,这就是您看到错误的原因。要解决此问题,您需要创建一个包含两者的证书*.domain.comdomain.com以便可以为来自子域和顶级域的 HTTPS 流量提供服务。

有关如何执行此操作的更多信息,请参阅本文档: https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html

具体来说这一段:

  1. 要添加其他名称,请选择向此证书添加其他名称,然后在文本框中键入名称。这对于保护裸域或顶级域(例如 example.com)及其子域(例如 *.example.com)非常有用。