amazon-web-services - AWS ELB 导致 net::ERR_CERT_COMMON_NAME_INVALID 错误

标签 amazon-web-services amazon-ec2 aws-security-group aws-application-load-balancer aws-elb

当前在尝试通过 ALB 访问我的应用程序时收到 net::ERR_CERT_COMMON_NAME_INVALID

这是我当前的设置:

  • 使用 AWS Certificate Manager 创建了涵盖 example.com*.example.com 的 SSL 证书。
  • 负载均衡器后面有 2 个服务器 ec2 实例,另一个负载均衡器后面有 2 个客户端实例。
  • 我的 Route 53 托管区域中指向客户端 ALB 的别名记录。
  • 两个 ALB 都附加了 example.com 的 SSL 证书。
  • 两个 ALB 都有一个 HTTPS: 443 监听器,将 https 流量转发到端口 80 上的 ec2 实例。
  • 服务器 ALB 安全组允许来自客户端 ALB 安全组的入站流量和出站到服务器实例安全组的流量。
  • 客户端 ec2 实例中的应用程序是指向服务器 ALB 的 React 应用程序,地址为 https://xxxxxxxxxx.elb.amazonaws.com/api

通过 https://example.com 访问应用程序会导致控制台中出现 net::ERR_CERT_COMMON_NAME_INVALID,浏览器显示:

Error: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “xxxxxxxxxx.elb.amazonaws.com” which could put your confidential information at risk.

如果有帮助,我很乐意提供更多详细信息。

最佳答案

如果您拥有自己的域 example.com 并带有正确的 SSL 证书,则您不能使用 https://xxxxxxxxxx.elb.amazonaws.com/api是 AWS 域。原因是 SSL 证书适用于 example.com,而不适用于 https://xxxxxxxxxx.elb.amazonaws.com/api

您必须修改您的应用程序代码以仅使用 example.com

关于amazon-web-services - AWS ELB 导致 net::ERR_CERT_COMMON_NAME_INVALID 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67756492/

相关文章:

amazon-web-services - AWS 安全组与网络 ACL

c - hmac sha256 输出长度

linux - python脚本通过传递参数来检查磁盘空间

amazon-web-services - AWS : security groups ignoring traffic from elastic IP

amazon-web-services - Terraform:允许 aws 安全组内的所有内部流量

mysql - 如何从 EC2 ubuntu 系统连接到本地的 Mysql?

amazon-web-services - 出现错误 "cannot use immediate apply method for static parameter"

python - 为什么此 AWS IAM 策略仅适用于资源上的星号?

node.js - 尽管以 root 身份运行所有内容,为什么 aws 代码部署会抛出 "No passwd entry for user ' ec2-user'"错误?

python - Cherrypy 服务器因请求过多而结束