CloudFront 上的子域不起作用(不接受证书)

Nik*_*kov 6 amazon-web-services amazon-cloudfront

  • 在证书管理器中,我有一个有效的证书,其中包括 *.example.com 域。
  • 在 CloudFront 中,我有一个已启用 HTTP 到 HTTPS 重定向且 CNAME 字段为空的分配。
  • 当我编辑分发并在 CNAME 字段中输入 staging.example.com 并选择证书时,我收到以下错误:
com.amazonaws.services.cloudfront.model.InvalidViewerCertificateException: The certificate that is attached to your distribution doesn't cover the alternate domain name (CNAME) that you're trying to add. For more details, see: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-requirements (Service: AmazonCloudFront; Status Code: 400; Error Code: InvalidViewerCertificate; Request ID: 8406d8d5-65c3-11e9-afc0-65457a0a2bea)
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?顶级域的另一个发行版使用相同的证书可以正常工作。

Bru*_*sky 11

确保您只是试图让*.匹配单个子域。查看子域上的通配符 ssl

也就是说*.example.com会匹配sub1.example.comsub2.example.com,但不会匹配sub2.sub1.example.com。最后,您不能*.*.example.com. 为了匹配最后一种情况,您必须请求*.sub1.example.com.


Nik*_*kov 7

弄清楚了。

证书是在错误的地区生成的。将在 CloudFront 分配上使用的证书必须在 us-east-1(弗吉尼亚州)上生成。