Trying to fetch from netlify function to AWS [Hostname/IP does not match certificate's altnames]

Hey, I have a question of how to make something rather than a Issue. I’ve being trying to read docs but I couldn’t answer this directly.

Take a look at this schema:

I’m using svelte-kit app.
I send graphql queries to the server (hosted on netlify) then it sends back to my backend.

I can’t figure out why is the server considering the netlify’s altname instead of my custom domain name to fetch my backend server, so I wouldn’t need to keep adding netlify altname to my dns everytime I need to tweak something.

I’d like my netlify function to use my custom domain name to fetch my backend. Is it possible? I know I lack some knoledge about DNS… but could I have some tips on it?

Complete error:

ERROR FetchError: request to https://api.mydomain.com/graphql failed, reason: Hostname/IP does not match certificate’s altnames: Host: festive-lewin-05e068.netlify.app. is not in the cert’s altnames: DNS:*.execute-api.sa-east-1.amazonaws.com

Hi, @outerlook. Are you seeing that error in the function logs at Netlify or somewhere else (and if somewhere else - where do you see it)?

There is nothing at Netlify that would change the domain name used so my best guess is that there is something in the function code causing this.

Also, it seems clear that https://api.mydomain.com/graphql is an example URL. Would it be possible to get the real URL from the error message? Also, what is a URL that I can load that triggers the error in question?

You can post that information publicly or you can private message (PM) that to one of our support staff. I’ve confirmed that PMs are enabled for your community login. Please keep in mind that only one person can see the PM and this will likely mean a slower reply than posting the information publicly. Please feel free to reply to however you prefer though.

Hey @luke , thanks for your response! I just figured out, as you said, it was on my function part. There was a spread param that was passing an kind of ‘same-site’ (but from a property I was not aware of, not cors policy) header to my backend. I appreciate your guidance!

1 Like

Hi, @outerlook. Thank you for taking the time to share more details about the root cause and solution.

That kind of extra detail can be very helpful for others searching this site for solutions an, as a member of the Netlify support team, I thank you for taking the time to follow-up with that information. :+1:

1 Like