Hostname/IP does not match certificate's altnames: Host: xxx.netlify.app. is not in the cert's altnames: DNS:illegal.mdes.go.th

Hello,

my site is https://darling-brigadeiros-d24ef5.netlify.app/.netlify/functions/upload

I have netlify function running, when I call it, I get this error:

Hostname/IP does not match certificate's altnames: Host: main--darling-brigadeiros-d24ef5.netlify.app. is not in the cert's altnames: DNS:illegal.mdes.go.th

Does it mean I can’t call it from Thailand? It works for a friend based in EU.

Any help is MUCH appreciated, I do not have the knowledge to fix this.

I don’t see a site hosted at darling-brigadeiros-d24ef5.netlify.app so how are you calling the function, and where are you calling it from?

Can you post a screenshot of the error you are seeing and a way to replicate the issue.

So there is no site, as in any front-end. It’s just 1 netlify function with JS code really.

The function is a scraping script, you provide some url to it in a param, like
?url=https://google.com
so just send a GET to https://darling-brigadeiros-d24ef5.netlify.app/.netlify/functions/upload?url=https://google.com

you will get a timeout because it’s not made for scraping google, but that’s ok. I am not getting a timeout, Im getting an error

I think it has to do something with thai DNS service or IDK, note the “DNS:” field in the message

What is it made for scraping then?

You do realise a function has an execution limit of 10 seconds?

I prefer not to say, sorry. Yes I know of the limit, this is not the issue. I get the error within 200ms of sending the request. I know you don’t get the error probably, because I think it’s because I am in thailand, in EU it works.

This casts great doubt in my mind over the legality and ethics of what you are doing.

I suggest you read the Netlify Terms of Service and the Acceptable Use Policy. If you are found to breach these Netlify will ban you from the platform.

woah where is this coming from? I simply don’t want to say because I don’t want to hint people about my idea. Where is the trust. :smiley:

I hope someone can help me with the DNS stuff tho and knowledge about altnames. Maybe I try to watch a YT about it but idk if it helps me :smiley:

If I go to the URL reported in your error illegal.mdes.go.th, I see this:

So looks liek your local network or the government is blocking the access to that site.

Yes I don’t know why. I am not doing anything illegal, at least I don’t think so. It’s possible thailand government is blocking netlify functions?? everything else seems to work for me

No one was/is suggesting you were/are.

Quite likely the are blocking all netlify.app sites. As a test, can you access https://example.netlify.app/?

If you can’t then they are blocking everything. If you can then it would appear something is amiss with your site. In either case there is nothing Netlify can do about it. You’ll need to speak with the relevant government agencies.

You might get around this by using a public DNS (outside Thailand) such as Google Public DNS or 1.1.1.1.

1 Like

ok thank you very much. https://example.netlify.app/ is working, for now I solved it by doing this How to test Netlify Functions locally

I am running the function locally. I needed it for local development purposes anyways, my users are not going to be from thailand, it’s just so happens I am travelling here.

Thank you!