Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Add toggle mode for HTTP Nowhere#379

Merged
diracdeltas merged 14 commits intomasterfrom
http-nowhere
Jul 29, 2014
Merged

Add toggle mode for HTTP Nowhere#379
diracdeltas merged 14 commits intomasterfrom
http-nowhere

Conversation

@diracdeltas
Copy link
Contributor

Many people, including the celebrated Jimmy Wales, have asked us to include an "HTTP Nowhere" mode in HTTPS Everywhere. Inspired by Chris Wilper's HTTP Nowhere add-on v1.0 (https://addons.mozilla.org/en-us/firefox/addon/http-nowhere/, licenced GPLv3), I added this feature.

Currently it does this by changing Firefox's default HTTP proxy (accessible in about:preferences) to a null proxy (localhost:4) while enabled.

TODOs:

  • Probably better to register our own proxy filter for HTTP requests instead of changing the default HTTP proxy.
  • Replace the confusing page that says "The proxy server is refusing connections" with a custom page telling the user that they are unable to load a site because HTTP Nowhere is active. I have no idea how to modify Firefox's internal error pages; if this is impossible, maybe we need to use an nsIProtocolHandler for "http://" instead of proxying.

UPDATE: Am leaning toward rewriting this as an HTTP/FTP/etc. protocol handler after realizing that messing with proxy settings causes the TorButton UI to look very alarming if you're using Tor Browser.

@diracdeltas
Copy link
Contributor Author

Just realized this causes side effects in Tor browser, since TorButton also interferes with FF proxy settings. Namely, since we've changed the FF proxy settings, the TorButton icon will show up with a red X when HTTP Nowhere is on.

However, going to "check.torproject.org" still indicates that HTTPS requests are going over Tor when HTTP Nowhere is enabled.

@semenko
Copy link
Contributor

semenko commented Jul 25, 2014

Cool concept! I'll implement a similar toggle in Chrome.

@diracdeltas
Copy link
Contributor Author

@semenko cool, I was hoping you would so I don't ever have to learn chrome extension development. :)

FWIW, there is a Chrome flag that sets HTTP proxies - not sure if it's modifiable from extension land.

@semenko
Copy link
Contributor

semenko commented Jul 25, 2014

This is ~one line with a blocking webRequest :)

chrome.webRequest.onBeforeRequest.addListener( function(details) { return {cancel: true}; }, {urls: ["http://*"]}, ["blocking"]);

@diracdeltas
Copy link
Contributor Author

That one line is not 80 characters or less! :P

BTW is there OCSP enforcement mode in Chrome? This suggests yes: https://superuser.com/questions/261746/security-ocsp-require-in-google-chrome/264035#264035

@semenko
Copy link
Contributor

semenko commented Jul 25, 2014

Yep. Not sure its API accessible. Of course, revocation checking is a security placebo (and privacy nightmare!). IIRC, Chrome is removing that option in the future, relying instead on CRLSets and the new OCSP stapling required flag.

@diracdeltas
Copy link
Contributor Author

Rewrote blocking to happen in http-on-modify-request because I couldn't override Firefox's existing protocol handlers without causing the browser to immediately crash with a SIGSEGV error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can take out this OCSP-related portion of the patch; HTTPSEverywhere.shouldIgnoreURI() should now be ensuring that OCSP requests are left alone before we call HTTPS.replaceChannel()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusingly, shouldIgnoreURI is itself ignored if HTTPSNowhere is enabled. So this is still needed.

The rationale is that if a user wants HTTP Nowhere, we shouldn't let HTTP requests through even if they're OCSP.

@pde
Copy link
Contributor

pde commented Jul 29, 2014

Aside from the bug and enhancement flagged above, this looks good to merge if it has been tested a bit.

diracdeltas added a commit that referenced this pull request Jul 29, 2014
Add toggle mode for HTTP Nowhere
@diracdeltas diracdeltas merged commit 3b0777f into master Jul 29, 2014
@diracdeltas diracdeltas deleted the http-nowhere branch July 29, 2014 01:25
@cwilper
Copy link

cwilper commented Jul 31, 2014

Yay! Great to see this work happening in HTTPS Everywhere. Ping me when ready and I'll be sure to update the description of the http-nowhere FF extension.

@diracdeltas
Copy link
Contributor Author

@cwilper Thanks for the inspiration. Pull requests here are welcome too. :)

@lofidevops
Copy link

This sounds interesting! How do I enable it (using 5.0dev.0 on Firefox)? Does it offer a whitelist / temporary whitelist option?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants