4

I have started developing a web app using React.js that serves as the front-end for a bigger project. Cutting to the chase, my issue is that I cannot find a way to communicate with a secure (https) API. This is running locally, and since my organization has self-signed certificates the browsers do not accept them. Namely, Chrome, Firefox, Edge, and Opera were used, with all of them resulting in more or less the same error: NET::ERR_CERT_COMMON_NAME_INVALID and Cross-Origin Request Blocked.

Some context regarding the followed process around the certificates. They were installed both at the user and at the local machine levels as trusted authorities, without and with administrative rights. They were also imported into the browsers, all the while every endpoint has CORS enabled. Still, the errors remain and I am unable to seize data from a single axios GET call. As expected, when trying to communicate with the same non-secure (http) API, all calls go through without issues. Additionally, Postman and curling both yield desirable results in every case.

I have not found a way to bypass this error so that I can move on with my implementation. I have also advised several other questions here, like:

Any assistance is most welcome. I bid you all a lovely day!

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
  • 3
    Hi Asterios, did you find a solution for this. I am at the same level where you were. Thanks. – ORCAs Oct 17 '22 at 23:46
  • @ORCAs We have since migrated from React to Angular. It seems like a server side issue, that needs to be solved by the server's owner by including `access-control-allow-origin: *`, and/or also explicitly including the IP address of the requesting client. The issue originated from a self-signed certificate and we came across a solution some days ago. For development purposes, in case this does not work, you can also use the following run command for your browser to bypass the issue (e.g. for Chrome): `chrome.exe --user-data-dir="_.exe path_" --disable-web-security`. – Asterios Kalogeras Oct 26 '22 at 11:57

0 Answers0