0
votes

I followed the following tutorial to setup an SSL Certificate with a parent domain hosted at another provider than aws to create a secure connection to my REST Api. https://medium.com/@sonalishah_63223/how-to-host-subdomain-in-aws-route-53-for-an-existing-parent-domain-with-different-service-9b4dde061b85

Setup:

Hosted Zone -> Record pointing to - Elastic Load Balancer - Beanstalk -> EC2 (Spring Application)

Setup Description:

I created a hosted zone (sub.mydomain.at). In that hosted zone I created a record (api.sub.mydomain.at) pointing to the Elastic Load Balancer.

Everything works fine, API is callable.

Afterwards I created a certificate through ACM. (*.mydomain.at) which has been successfully issued.

I attached it to my load balancer and it seems to work, when calling the API via https://. But Postman throws the following error.

SSL Error: Hostname/IP does not match certificate's altnames

I could turn off "Enable SSL certificate verification" and it would work, but this does not seem to be the right solution. So I created another Certificate for the domain api.sub.mydomain.at which is not verifying. According to nslookup the server can't find the domain even if the CNAME is setup. (I assume it is not possible to create a CNAME with multiple 'sub-domains') _12312<long-_number>.api.sub.mydomain.at

So how can I resolve the Issue "Hostname/IP does not match certificates alt names"?

1

1 Answers

0
votes

I think in your case, you are forwarding the requests (cname record api.sub.mydomain.at from alb public dns to your custom domain) So you need to add ALB public dns name on hearder like this:

request({host: 'ALB public DNS'... headers: req.headers