flutter_secure_storage icon indicating copy to clipboard operation
flutter_secure_storage copied to clipboard

Can you add support for 0.0.0.0 IP?

Open jvv-g39 opened this issue 1 year ago • 3 comments

When I am running the flutter debug web app in Chrome at IP 0.0.0.0 to test it in mobile browser the flutter_secure_storage is not working. It is throwing the error JSNoSuchMethodError (TypeError: Cannot read properties of undefined (reading 'generateKey')). I found that it works only in localhost or with HTTPS. Why is there this limitation? Is there a way to enable running it in 0.0.0.0 IP address? We would want to run in other local IP ranges like 192.168.1.x etc. Thanks.

jvv-g39 avatar Jan 04 '24 06:01 jvv-g39

So you want to access that unencrypted via plain http without transport encryption? I think out of security you should simply not do that. It is not really hard to setup a https server.

rekire avatar Jan 07 '24 19:01 rekire

From what I understand I am using this package to write data encrypted. On web it stores that in local storage encrypted. I want to test the website on my mobile browser connected to the debug server to fix some UI issues. It is not practical to build the web app and deploy to local https server for each change I make. This is for debugging only. Having an option to whitelist IP addresses would be nice. When running in production I am using HTTPS. I don't see how this is insecure because be it HTTP or HTTPS the data stored in the localstore is encrypted by the package and I need to call the package API to get the data which is decrypted for read. Could you please elaborate on this, what I am missing?

Anyway, I found that the option to run Flutter debug server with TLS certs was added to master branch recently. Got certs generated and I was able to test the flutter web app locally on the mobile device browser by running the debug server with HTTPS. Had to spend a couple of hours to configure all these.

jsloop42 avatar Jan 07 '24 19:01 jsloop42

From https://github.com/mogol/flutter_secure_storage/issues/320#issuecomment-976308930:

After some searching it seems that webCrypto only works when the site is running HTTPS or localhost. How are you running your build?

Source: ipfs/js-ipfs#964 (comment)

rekire avatar Jan 07 '24 19:01 rekire

I am closing all older issues. If this issue still exists in the latest version, please let me know.

juliansteenbakker avatar Aug 13 '24 20:08 juliansteenbakker