Misunderstood Secure Context of Web Crypto API?

556 Views Asked by At

According to MDN documentation about Web Crypto Subtle API, and this answer: TypeError, 'digest' of undefined, in development environment

I understood that the API only works on localhost or over HTTPS protocol.

So, to validate this point, I deployed a front-end app using this API, behind a NGinx proxy on a desktop and tried to connect to this app from another computer.

Using Chrome, the code had been blocked because I'm not connecting on HTTP.

But using Firefox, these works without any alert. Did I miss something about Firefox?

1

There are 1 best solutions below

0
On BEST ANSWER

Ok, this was an issue and had been fixed in the latest release. https://bugzilla.mozilla.org/show_bug.cgi?id=1333140

Up to version 74, you were able to use WebCrypto API outside a secure context.

I updated to v75 and it's fine.