Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secure Storage in http (insecure) websites #29

Open
stefroussos opened this issue Apr 4, 2023 · 1 comment
Open

Secure Storage in http (insecure) websites #29

stefroussos opened this issue Apr 4, 2023 · 1 comment

Comments

@stefroussos
Copy link

Hello,
Since the Web Crypto API only works secure contexts (HTTPS), I get this error TypeError: Cannot read properties of undefined (reading 'importKey') in http websites. This could also result in throttling errors like Error: This request exceeds the MAX_WRITE_OPERATIONS_PER_MINUTE quota.. What's the best approach to store keys in such contexts? 1. Just use regular storage, 2. Use regular storage with crypto-js encryption, 3. Drop support for insecure websites? 4. Other.

Thanks

@louisgv
Copy link
Contributor

louisgv commented May 7, 2023

You can also detect whether it's HTTP or HTTPS, and swap your storage instance accordingly - if it's HTTPS, use SecuredStorage, if it's HTTP, use plain Storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants