blockstack-browser icon indicating copy to clipboard operation
blockstack-browser copied to clipboard

Mixed-content blocking prevents usage of storage on apps deployed with https

Open larrysalibra opened this issue 9 years ago • 12 comments

Browsers block requests to content by that doesn't use https by default when a site is served over https. This includes requests to localhost.

This means that Blockstack apps deployed on https can't access the user's local core node to use storage.

screen shot 2017-07-19 at 4 21 47 am screen shot 2017-07-19 at 4 21 37 am

larrysalibra avatar Jul 18 '17 21:07 larrysalibra

Some possible solutions:

  • Serve apps without https (undesirable)
  • Generate and install a self-signed certificate for the core node on the user's computer.

larrysalibra avatar Jul 18 '17 21:07 larrysalibra

@kantai in slack:

browser extensions could also solve the problem, without requiring users to approve a new cert and modify /etc/hosts

larrysalibra avatar Jul 18 '17 21:07 larrysalibra

This makes me frowny face. Are there any other options we have?

shea256 avatar Jul 18 '17 21:07 shea256

We should also bear in mind, that while addressing this problem, we should also address the potential issue raised during our security audit regarding pairing of Core <-> Browser (basically you want to establish that you both have a shared-secret without revealing the secret itself).

kantai avatar Jul 18 '17 21:07 kantai

Does moving to a native window help at all?

shea256 avatar Jul 18 '17 21:07 shea256

Also what about the update where we add a DNS TLD to the OS?

shea256 avatar Jul 18 '17 21:07 shea256

Does moving to a native window help at all?

Potentially, if apps are also run in the native window. On macOS, when blockstack browser is running in a webview, we already have to override the transport security settings that prevent apple's APIs from talking to non-http URLs by enabling http communication with localhost so that we can load the browser: https://github.com/blockstack/blockstack-browser/commit/b1dd018882ef3a0dd95f3ff2523456ccbf8c792c#diff-92b0aed9d619d77d756c26eb3a51861dR42

We can potentially load insecure content - not 100% sure, would need to try it, but there's a method that makes it look like it might work: https://developer.apple.com/documentation/webkit/wkwebview/1415002-hasonlysecurecontent

If that doesn't work, another option is to have calls to fetch in blockstack.js be handled through native code when apps are run in our own native app window.


I assume something like this is probably possible in an electron app as well.

larrysalibra avatar Jul 18 '17 21:07 larrysalibra

@larrysalibra @jackzampolin I am also running into this issue. I have reverted to http for now.

satbam avatar Nov 13 '17 14:11 satbam

I'm encountering this as well when trying to use blockstack storage calls (putFile and getFile). I'm not sure of a good way to fix beyond anything suggested already

patrickdevivo avatar Nov 13 '17 15:11 patrickdevivo

I'll add me name to the list here -- we're experiencing issues running on https and had to move over to an unsecured site to circumvent the mixed content errors.

wackenvoss avatar Nov 13 '17 15:11 wackenvoss

Could we use/do something like this? 🤔 https://github.com/cameronhunter/local-ssl-proxy

icidasset avatar Dec 02 '17 22:12 icidasset

This is solved with our new "direct to gaiahub" storage client library that allows apps to write directly to a gaia hub without proxying through a local core node. Apps can take advantage of this starting in blockstack.js 0.14.0 and can now enable https.

https://github.com/blockstack/blockstack.js/pull/314

larrysalibra avatar Dec 20 '17 13:12 larrysalibra