From 9c1d82c9f77f730448b986405e01f68ba1d95bea Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Thu, 20 May 2010 10:52:14 +0000 Subject: [PATCH] Minor bug fix to --proxy with HTTPS target on Python 2.6 - fixes #191. --- lib/core/option.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index cbc401d21..019cc2685 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -58,6 +58,7 @@ from lib.core.exception import sqlmapUnsupportedDBMSException from lib.core.optiondict import optDict from lib.core.settings import IS_WIN from lib.core.settings import PLATFORM +from lib.core.settings import PYVERSION from lib.core.settings import SITE from lib.core.settings import SUPPORTED_DBMS from lib.core.settings import SUPPORTED_OS @@ -546,7 +547,10 @@ def __setHTTPProxy(): # can't be tunneled over an HTTP proxy natively by Python (<= 2.5) # urllib2 standard library if conf.scheme == "https": - proxyHandler = ProxyHTTPSHandler(__proxyString) + if PYVERSION >= "2.6": + proxyHandler = urllib2.ProxyHandler({"https": __proxyString}) + else: + proxyHandler = ProxyHTTPSHandler(__proxyString) else: proxyHandler = urllib2.ProxyHandler({"http": __proxyString})