1

I have a system with where you can enable https for request but this will serve a self-signed certificate and I'm experimenting with writing a JavaScript shared worker, in normal http context it works fine. If I enable https then the fetch in the worker fails with a this status in the developer console:

(failed)net::ERR_INSECURE_RESPONSE.

I enabled "allow insecure content" in my browser, since the error says the response is insecure, but that did not help.

There is a setInterval running the fetch but the context should be correct.

Do workers know about thrust for for self signed certs? or is there something else that is going wrong here?

Espen Nilsen
  • 121
  • 1
  • 7
  • Those are two different meanings of "insecure" here. "allow insecure content" is about whether your browser is allowed to use certain resources such as for example JavaScript, if they were loaded _via HTTP_, into a document that itself was loaded via HTTPS. But that is not what you are dealing with here, you have a resource that you are requesting via HTTPS to begin with, but that fails, because the browser does not recognize the certificate as valid. So the latter is what you will need to achieve - you need to make your browser trust that certificate. – CBroe Feb 28 '22 at 09:09
  • Threads like [Getting Chrome to accept self-signed localhost certificate](https://stackoverflow.com/q/7580508/1427878) (for other browsers, you should be able to find similar ones) have hints, although part of the info is rather old, you'd have to check if it still works using those ways. – CBroe Feb 28 '22 at 09:10

0 Answers0