Currently getting the net::ERR_CERT_COMMON_NAME_INVALID when trying to access my application through the ALB.
This is my current setup:
- SSL Certificate created that covers
example.com&*.example.comusing AWS Certificate Manager. - 2 server ec2 instances behind a load balancer and 2 client instances behind another load balancer.
- An alias record in my Route 53 hosted zone pointing to the client ALB.
- Both ALBs have the SSL certificate for
example.comattached to them. - Both ALBs have a single
HTTPS: 443listener forwardinghttpstraffic to ec2 instances on port 80. - The server ALB security group allows inbound traffic from the client ALB Security Group and outbound to the server instances security group.
- The applications in the client ec2 instances are React Apps pointing to the server ALB at
https://xxxxxxxxxx.elb.amazonaws.com/api
Accessing the application via https://example.com causes net::ERR_CERT_COMMON_NAME_INVALID in the console with the browser saying:
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.
I'd be happy to provide more details if it helps.
If you have your own domain
example.comwith correct SSL certificate then you can't usehttps://xxxxxxxxxx.elb.amazonaws.com/apiwhich is AWS domain. The reason is that SSL cert is forexample.com, not forhttps://xxxxxxxxxx.elb.amazonaws.com/api.You have to modify your application code to only use
example.com.