Random Quote Machine : Failed to load resource: net::ERR_CERT

I builded the project in React but Ihad a lot of problems with the API connection to get quotes, first I had a CORB problem, and then I changed the API endpoint and got the following message in the Google console:

Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID
App.js:45 error is TypeError: Failed to fetch

Here is my project : https://github.com/Natcancein/FreeCodeCamp/tree/master/FrontEndLibrariesProjects/build-random-quote-machine

and here is published:
https://natcancein.github.io/random-quote-machine/

Helpme please :sweat:

Looks like the certification for that site is invalid so the fetch API won’t do anything with it (https://support.mozilla.org/en-US/kb/what-does-your-connection-is-not-secure-mean#w_ssl-error-bad-cert-domain)

thanks, I have tried a lot of api websites, but I have not any lucky :fearful:.
Besides, when I try in local works fine (npm start), but when I deploy in gh-pages the problems appears.

Github pages have SSL certificate and your API endpoint doesn’t have one, that’s why it gives the error.
And it works locally because you wouldn’t have any SSL certificate on localhost.

You will need to use an API that allows CORS and have a valid SSL certificate.

If that sounds a lot of work to find to signup for the APIs or you couldn’t find any free API, just use the following link to get all the quotes in one go and use them:

Or you can create your custom quotes JSON file and upload it to Github and use it.

1 Like

Thanks a lot!!!, Greetings from Chile! :innocent::grinning::smiley:

1 Like