From e4ed1c058b3f69619e72aee519d880495f163711 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 18 Dec 2015 17:15:59 +0100 Subject: [PATCH] Minor error message improvement (SSL issues) --- lib/request/httpshandler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/request/httpshandler.py b/lib/request/httpshandler.py index 5cf0613ca..9ada558d2 100644 --- a/lib/request/httpshandler.py +++ b/lib/request/httpshandler.py @@ -5,6 +5,7 @@ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ +import distutils.version import httplib import socket import urllib2 @@ -13,6 +14,7 @@ from lib.core.common import getSafeExString from lib.core.data import kb from lib.core.data import logger from lib.core.exception import SqlmapConnectionException +from lib.core.settings import PYVERSION ssl = None try: @@ -84,7 +86,10 @@ class HTTPSConnection(httplib.HTTPSConnection): logger.debug("SSL connection error occurred ('%s')" % getSafeExString(ex)) if not success: - raise SqlmapConnectionException("can't establish SSL connection") + errMsg = "can't establish SSL connection" + if distutils.version.LooseVersion(PYVERSION) < distutils.version.LooseVersion("2.7.10"): + errMsg += " (please retry with Python >= 2.7.10)" + raise SqlmapConnectionException(errMsg) class HTTPSHandler(urllib2.HTTPSHandler): def https_open(self, req):