From 0a83a830d9c6d58176624cb3ad54c8efe39d9324 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Fri, 12 Nov 2010 14:21:46 +0000 Subject: [PATCH] Properly handle both HTTPS and HTTP requests through proxy --- lib/core/option.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 28afa3d77..226c04e7e 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -668,11 +668,10 @@ def __setHTTPProxy(): # HTTPS over (Squid) Proxy fails) as long as HTTP over SSL requests # can't be tunneled over an HTTP proxy natively by Python (<= 2.5) # urllib2 standard library - if conf.scheme == "https": - if PYVERSION >= "2.6": - proxyHandler = urllib2.ProxyHandler({"https": __proxyString}) - else: - proxyHandler = ProxyHTTPSHandler(__proxyString) + if PYVERSION >= "2.6": + proxyHandler = urllib2.ProxyHandler({"http": __proxyString, "https": __proxyString}) + elif conf.scheme == "https": + proxyHandler = ProxyHTTPSHandler(__proxyString) else: proxyHandler = urllib2.ProxyHandler({"http": __proxyString})