4

I'm creating a VS Code extension with a webview that contains a React application. In the React code, I'm making a GET request to a REST API, but it keeps failing due to the following error:

Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID

Any ideas on why this may be happening or a workaround? Maybe this is a restriction of webviews?

If I make the call in the extension code, it works fine.

greenharbour
  • 286
  • 2
  • 14
  • Is the server & domain you're making the request to one you control? If so, I would check the validity of the certificate. – prieber Sep 17 '19 at 16:40
  • See as well https://stackoverflow.com/questions/36506539/how-do-i-get-visual-studio-code-to-trust-our-self-signed-proxy-certificate – Wollmich Aug 18 '20 at 14:38

2 Answers2

2

I upgrade the version of my browser to the latest and it worked me. find this below given link to know how to update browser version. https://www.computerhope.com/issues/ch001388.htm

Ravi Mengar
  • 1,181
  • 1
  • 11
  • 18
1

Assuming that you get this error about the certificate of the remote side (the one serving the REST API), you get this error because of one of the following:

  • the authority that signed the certificate is not recognized on the client side (ie : the authority is not installed on your PC)
  • the certificate has expired
  • your PC has a wrong date

You can correct the above, or as a workaround you can (depending on your tools) explicitly ignore the untrusted remote certificate. But this workaround should remain for test purpose only, as it is a security breach.

user803422
  • 2,636
  • 2
  • 18
  • 36