2Cool
2Cool

Reputation: 111

POST request error - net::ERR_CERT_COMMON_NAME_INVALID

I am trying to send a POST request for the react app hosted on firebase to the API built using express.js and firebase cloud functions.

when I try to send a request it fails with an error message:

POST "Request URL" net::ERR_CERT_COMMON_NAME_INVALID

when I searched for the error I came to know (maybe) that this issue is related to the SSL certificate. I am not using any custom domain both the URL of API and web app is provided by firebase and have the SSL certificate.

Here's the error image:

enter image description here

The API works fine when tested with the postman.

Also, the error is the same for both the localhost and the URL provided by the firebase. PS: I am using Axios to send the post request.

Please help!! any hint will be helpful. Thank you.

Upvotes: 2

Views: 6572

Answers (3)

JR Lawhorne
JR Lawhorne

Reputation: 3302

For local testing...

I'm able to go the server address using https (on localhost but with a different host name address resolved in /etc/hosts). I get a security warning in Chrome when visiting the site using https. If I tell Chrome to go to the site anyway (override the warning), I can then make API calls to the same address.

Upvotes: 0

Jacob Okello Okomo
Jacob Okello Okomo

Reputation: 381

As well, The NET::ERR_CERT_COMMON_NAME_INVALID error happens when the browser fails to verify a website’s SSL certificate and is therefore unable to establish a secure connection. This issue usually occurs due to misconfiguration of the certificate on a server. Kindly consider review your Backend Server Configurations too.

Upvotes: 1

fractalix
fractalix

Reputation: 451

Are you manually setting the Cloud Function URL? That www at the beginning should not be there.

Upvotes: 1

Related Questions