Minor bug fix to --proxy with HTTPS target on Python 2.6 - fixes #191.

This commit is contained in:
Bernardo Damele 2010-05-20 10:52:14 +00:00
parent bffa06f2ca
commit 9c1d82c9f7

View File

@ -58,6 +58,7 @@ from lib.core.exception import sqlmapUnsupportedDBMSException
from lib.core.optiondict import optDict from lib.core.optiondict import optDict
from lib.core.settings import IS_WIN from lib.core.settings import IS_WIN
from lib.core.settings import PLATFORM from lib.core.settings import PLATFORM
from lib.core.settings import PYVERSION
from lib.core.settings import SITE from lib.core.settings import SITE
from lib.core.settings import SUPPORTED_DBMS from lib.core.settings import SUPPORTED_DBMS
from lib.core.settings import SUPPORTED_OS from lib.core.settings import SUPPORTED_OS
@ -546,6 +547,9 @@ def __setHTTPProxy():
# can't be tunneled over an HTTP proxy natively by Python (<= 2.5) # can't be tunneled over an HTTP proxy natively by Python (<= 2.5)
# urllib2 standard library # urllib2 standard library
if conf.scheme == "https": if conf.scheme == "https":
if PYVERSION >= "2.6":
proxyHandler = urllib2.ProxyHandler({"https": __proxyString})
else:
proxyHandler = ProxyHTTPSHandler(__proxyString) proxyHandler = ProxyHTTPSHandler(__proxyString)
else: else:
proxyHandler = urllib2.ProxyHandler({"http": __proxyString}) proxyHandler = urllib2.ProxyHandler({"http": __proxyString})