【发布时间】:2020-09-11 00:31:17
【问题描述】:
我的设置
- EC2:应用程序
- 域名注册商:namecheap
- DNS:路由 53
我使用 EC2 来托管我的应用程序,使用 AWS 路由 53 来引导 url,并使用 cloudfront 来获取我的应用程序的静态文件。现在云端正在使用不友好的域名*.cloudfront.net。
我在我的 EC2 中使用 certbot 来提供 SSL 连接。
当我尝试更改云端域名时,我使用由 ACM(AWS 证书管理器)生成的 Custom SSL Certificate。我遇到了错误:
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: 2d39c685-bf17-4d24-9c4b-82955daa878f; Proxy: null)
ACM 证书是在 N.Virginia 生成的,这很好,因为我的 EC2 托管在那里。我使用*.example.com 生成了证书并通过了验证。
我不知道如何解决这个问题。有什么建议吗?
【问题讨论】:
-
您好,您能否提供有关 ACM 证书的更多信息?是 ACM 生成的还是你上传的?是单域还是多域?
-
@mokugo-devops 它由 ACM 生成。单域:
*.example.com -
好的,您使用的域是 *.example.com,而不是 example.com?
-
没错。基于 ACM:
Type the fully qualified domain name of the site you want to secure with an SSL/TLS certificate (for example, www.example.com). Use an asterisk (*) to request a wildcard certificate to protect several sites in the same domain. For example: *.example.com protects www.example.com, site.example.com and images.example.com. -
@mokugo-devops 这不是我的问题,必须等待 OP 确认其是否完全解决。但这似乎是事实。
标签: amazon-web-services ssl amazon-cloudfront amazon-route53 certbot