ditch required proxied sites
We should rework the concept of required proxied sites. Instead of adding the domain of a service we use like google.com as a required proxied site that the user can't remove, we can just proxy internally-generated requests to it on an as-needed basis.
from #429:
http://support.google.com/chrome/bin/answer.py?answer=126299 says:
Once installed, Chrome will attempt to automatically update whenever it detects that a newer version of the browser is available. However, your network configuration may prevent the browser from updating properly. It's recommended that you bookmark this page and come back periodically to manually download newer versions of Chrome.
Reading between the lines, I wonder if they're referring to countries that censor requests to google.com. If Lantern starts depending on an up-to-date Chrome install, it would make sense for Lantern to consider Chrome's update availability check requests as part of Lantern's required services, and proxy them through Lantern when necessary to make sure they work.
Other requests to Lantern required services include:
- feedback submission requests through Lantern's built-in contact form
- statistics reporting requests for users that have enabled auto-reporting
- exceptional.io requests for users that have enabled auto-reporting
And as of #493:
- query.yahooapis.com (IP -> (lat, lon) lookup)
So keep in mind that in some cases these required domains happen internally, and sometimes they don't Google OAuth sites, for example, are hit from the browser outside of our control.
@myleshorton Meaning sometimes Lantern generates a required request, and sometimes Chrome does? I wonder if it's easy to detect Chrome generated ones. They'd still go through Lantern when it's set as the browser's proxy, right?
@skivvies Yeah exactly. We won't see the request from chrome unless it's on the whitelist and added to the pac file as a result.
The Google oauth sites are in that category now, and we do some special stuff to handle those.
The only other one that comes to mind is google analytics. Any others?
I think we can actually close this now, though, as I think we've taken this as far as we can. Not much we can do about google analytics and the oauth stuff as far as I can tell, although we could just make google analytics optional, and it just won't get reported if they take it off.
Looking at 197a1c2 and 197a1c2, I think we may not be in sync on this ticket, unless I'm misunderstanding how it's being implemented on the backend. The idea was to not have any "default" entries, i.e. entries in the pac file that aren't on the user's own proxied sites list, which would affect user-generated requests instead of only Lantern- (and Chrome-) generated ones.
So to do this correctly then, when Lantern needs to make a request to a required service that might be blocked (or when Chrome needs to, if we can tell), we would 1) check if the host is not already on the user's proxied sites list, and if not, (ideally 1.5) figure out if the host is blocked, which is hard in its own right, and only if so,) 2) have the request bypass the pac file and go straight through a Lantern proxy in isolation. I think we would have to temporarily switch from using a pac file to all-java logic to allow this, which is complex. :cry: But I don't think there's any other way to guarantee this works, is there?
The only other one that comes to mind is google analytics. Any others?
Whatever backend we use for the new contact modal? (see this comment)
Hmnn...those links are to the same revision, but now I'm totally confused about what the goal is here. What exactly is the problem now in Lantern that we're trying to solve? Having sites the user can't configure? What's the issue from the user's perspective?
Sorry, the issue description is definitely lacking here. The issue from the user's perspective is "google.com isn't blocked where I live! Why is lantern requiring me to keep it on my proxied sites list?" The proxied sites list affects all the user's requests. Lantern shouldn't hijack it for its own purposes, it should deal with required requests separately. I totally failed to think of this when I designed the proxied sites list UI initially!
For Lantern's own requests, it should have separate logic like:
- Can we reach the service directly? If so, just make this request directly.
- Otherwise, proxy this request through a Lantern proxy. This shouldn't affect the user's own requests, just this one.
Note that requests to Lantern required services can be made in Give Mode, as well as Get Mode, and even before initial setup is complete too (in particular before the user has even picked a mode or signed in). Ideally Lantern would just make sure those requests have as much chance of succeeding as possible, and the logic should be independent of whatever's going on with the user at the time.
Hopefully that explains the issue better, and it's not too tricky to do something more correct than what we're doing now. It looks like there are many, many countries where there is significant blocking, but where the hosts of our required services aren't blocked. So if possible we shouldn't force them on the proxied sites list, but should make sure those requests do get proxied when necessary.
OK, sounds good. I don't think we're that far apart actually. Let's enumerate all of these cases just for completeness.
Sites Lantern internally generates requests to
- docs.google.com (feedback form)
- exceptional.io -- error reporting
- query.yahooapis.com (geo data lookup)
- www.googleapis.com (oauth)
So all of these are just generated internally and are proxied internally as a result of the above changes, so they don't impact the user's browsing at all or the user's proxy settings. Since these are only generated internally and without a great deal of frequency, I don't think it's a problem to just proxy them.
Sites the dashboard generates requests to
- analytics.google.com (I think that's the subdomain -- not seeing it actually hooked up in lantern-ui at the moment)
- sites hit during oauth -- accounts.google.com, gstatic, googleusercontent, youtube.com
The oauth sites are handled specially -- we just temporarily proxy access to them during the oauth handshake to make sure the oauth pages are accessible. We still need to enumerate those last couple of sites and make sure we proxy all of them though (#502). I also think there might be a bug where we don't always unproxy them. Since these are just proxied for a brief moment during the handshake, I similarly don't think it's an issue to just proxy them.
That leaves analytics.google.com, which I think is really the only one that falls into the category you're talking about where Lantern is proxying a site for user requests from the browser in get mode that might actually be unblocked. That's an interesting case because so many sites use it -- would be nice if we didn't have to proxy all of those requests. Accomplishing that is a little hairy, though, as it's just hard to tell if a site is actually accessible or not. You could check for something resembling the javascript google returns, but those responses inevitably change, and it would theoretically be possible for censors to modify or forge them. You could somehow compare it to what's returned from a place we know is unblocked, but at that point we might as well just proxy it.
So I guess the question is how bad is it to just proxy access to analytics.google.com, and how much work do we really want to put into this. I vote for just including it for now in the PAC file unless there's some easy solution.
I should also say that in general I definitely think we should be taking the more dynamic approach of proxying things as we programmatically discover they're blocked, but I just think that's too much to tackle given the million other things going in to this release.
Additional required service (for global stats):
- lanternctrl.appspot.com
Might make sense to just add a retryhandler to LanternHttpClient that actually retries via the proxy...
There appears to be a bug in HttpClient with redirects to TLS sites via TLS proxies. See:
https://issues.apache.org/jira/browse/HTTPCLIENT-1318
Trying to determine simple workaround.
Are we sure about that bug? It looks like exceptional.io's SSL is misconfigured or something.
Notice the error when you enter it here: http://www.digicert.com/help/
And curl (openssl) refuses to get it as well.
Good catch @leahxschmidt. Just notified Exceptional of the issue.
Yeah they basically get the same error getlantern.org gets. We just include their signing cert in any case (digicert high assurance CA).
Does the test include that signing cert? Because I think the lack of that is what's causing the failure -- not any error in httpclient
On Fri, Feb 8, 2013 at 8:47 PM, myleshorton [email protected]:
Yeah they basically get the same error getlantern.org gets. We just include their signing cert in any case (digicert high assurance CA).
— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/473#issuecomment-13324073..
@myleshorton I'm getting a number of SSL-related exceptions on this branch.
With tests or when running Lantern or both?
On Wed, Feb 13, 2013 at 12:41 PM, ghostdance [email protected]:
@myleshorton https://github.com/myleshorton I'm getting an number of SSL-related exceptions on this branch.
— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/473#issuecomment-13517007.