diff options
author | pasko@google.com <pasko@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-10 12:49:38 +0000 |
---|---|---|
committer | pasko@google.com <pasko@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-10 12:49:38 +0000 |
commit | 4429523aae3d7f67b0a92f348faa0d754eb018e2 (patch) | |
tree | 87c7115f19f0d6e185c56ec2bc88041a6c0ef617 /net/proxy | |
parent | 4f35c8ba46474874adfd4e492a9146443459a389 (diff) | |
download | chromium_src-4429523aae3d7f67b0a92f348faa0d754eb018e2.zip chromium_src-4429523aae3d7f67b0a92f348faa0d754eb018e2.tar.gz chromium_src-4429523aae3d7f67b0a92f348faa0d754eb018e2.tar.bz2 |
Use SCHEME_HTTP for HTTPS proxies on Android.
This makes the ProxyServer setup aligned with the Linux implementation (see
proxy_config_service_linux.cc) which never uses SCHEME_HTTPS.
BUG=162908
TEST=Set up proxy in Android WiFi settings, go to https://google.com, observe
the page gets loaded.
Review URL: https://chromiumcodereview.appspot.com/11438047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r-- | net/proxy/proxy_config_service_android.cc | 8 | ||||
-rw-r--r-- | net/proxy/proxy_config_service_android_unittest.cc | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc index 694898e..f48c366 100644 --- a/net/proxy/proxy_config_service_android.cc +++ b/net/proxy/proxy_config_service_android.cc @@ -118,12 +118,16 @@ void AddBypassRules(const std::string& scheme, bool GetProxyRules(const GetPropertyCallback& get_property, ProxyConfig::ProxyRules* rules) { // See libcore/luni/src/main/java/java/net/ProxySelectorImpl.java for the - // equivalent Android implementation. + // mostly equivalent Android implementation. There is one intentional + // difference: by default Chromium uses the HTTP port (80) for HTTPS + // connections via proxy. This default is identical on other platforms. + // On the opposite, Java spec suggests to use HTTPS port (443) by default (the + // default value of https.proxyPort). rules->type = ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME; rules->proxy_for_http = LookupProxy("http", get_property, ProxyServer::SCHEME_HTTP); rules->proxy_for_https = LookupProxy("https", get_property, - ProxyServer::SCHEME_HTTPS); + ProxyServer::SCHEME_HTTP); rules->proxy_for_ftp = LookupProxy("ftp", get_property, ProxyServer::SCHEME_HTTP); rules->fallback_proxy = LookupSocksProxy(get_property); diff --git a/net/proxy/proxy_config_service_android_unittest.cc b/net/proxy/proxy_config_service_android_unittest.cc index 4d31bad..b7bdb3e 100644 --- a/net/proxy/proxy_config_service_android_unittest.cc +++ b/net/proxy/proxy_config_service_android_unittest.cc @@ -265,7 +265,7 @@ TEST_F(ProxyConfigServiceAndroidTest, HttpsProxyHostAndPort) { ProxySettingsChanged(); TestMapping("ftp://example.com/", "DIRECT"); TestMapping("http://example.com/", "DIRECT"); - TestMapping("https://example.com/", "HTTPS httpproxy.com:8080"); + TestMapping("https://example.com/", "PROXY httpproxy.com:8080"); } TEST_F(ProxyConfigServiceAndroidTest, HttpsProxyHostOnly) { @@ -274,7 +274,7 @@ TEST_F(ProxyConfigServiceAndroidTest, HttpsProxyHostOnly) { ProxySettingsChanged(); TestMapping("ftp://example.com/", "DIRECT"); TestMapping("http://example.com/", "DIRECT"); - TestMapping("https://example.com/", "HTTPS httpproxy.com:443"); + TestMapping("https://example.com/", "PROXY httpproxy.com:80"); } TEST_F(ProxyConfigServiceAndroidTest, HttpProxyHostIPv6) { @@ -312,7 +312,7 @@ TEST_F(ProxyConfigServiceAndroidTest, DefaultProxyExplictPort) { ProxySettingsChanged(); TestMapping("ftp://example.com/", "PROXY httpproxy.com:8080"); TestMapping("http://example.com/", "PROXY defaultproxy.com:8080"); - TestMapping("https://example.com/", "HTTPS defaultproxy.com:8080"); + TestMapping("https://example.com/", "PROXY defaultproxy.com:8080"); } TEST_F(ProxyConfigServiceAndroidTest, DefaultProxyDefaultPort) { @@ -320,7 +320,7 @@ TEST_F(ProxyConfigServiceAndroidTest, DefaultProxyDefaultPort) { AddProperty("proxyHost", "defaultproxy.com"); ProxySettingsChanged(); TestMapping("http://example.com/", "PROXY defaultproxy.com:80"); - TestMapping("https://example.com/", "HTTPS defaultproxy.com:443"); + TestMapping("https://example.com/", "PROXY defaultproxy.com:80"); } TEST_F(ProxyConfigServiceAndroidTest, FallbackToSocks) { |