mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 00:04:23 +03:00
Removing last remnants of bad handling the exceptions as strings
This commit is contained in:
parent
e59a220199
commit
c1f829d131
|
@ -1278,8 +1278,8 @@ def checkNullConnection():
|
||||||
infoMsg = "NULL connection is supported with 'skip-read' method"
|
infoMsg = "NULL connection is supported with 'skip-read' method"
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
except SqlmapConnectionException, errMsg:
|
except SqlmapConnectionException, ex:
|
||||||
errMsg = getUnicode(errMsg)
|
errMsg = getUnicode(ex.message)
|
||||||
raise SqlmapConnectionException(errMsg)
|
raise SqlmapConnectionException(errMsg)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
@ -1326,7 +1326,7 @@ def checkConnection(suppressOutput=False):
|
||||||
else:
|
else:
|
||||||
kb.errorIsNone = True
|
kb.errorIsNone = True
|
||||||
|
|
||||||
except SqlmapConnectionException, errMsg:
|
except SqlmapConnectionException, ex:
|
||||||
if conf.ipv6:
|
if conf.ipv6:
|
||||||
warnMsg = "check connection to a provided "
|
warnMsg = "check connection to a provided "
|
||||||
warnMsg += "IPv6 address with a tool like ping6 "
|
warnMsg += "IPv6 address with a tool like ping6 "
|
||||||
|
@ -1336,7 +1336,7 @@ def checkConnection(suppressOutput=False):
|
||||||
singleTimeWarnMessage(warnMsg)
|
singleTimeWarnMessage(warnMsg)
|
||||||
|
|
||||||
if any(code in kb.httpErrorCodes for code in (httplib.NOT_FOUND, )):
|
if any(code in kb.httpErrorCodes for code in (httplib.NOT_FOUND, )):
|
||||||
errMsg = getUnicode(errMsg)
|
errMsg = getUnicode(ex.message)
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
|
|
||||||
if conf.multipleTargets:
|
if conf.multipleTargets:
|
||||||
|
|
|
@ -55,9 +55,9 @@ class HTTPSConnection(httplib.HTTPSConnection):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
sock.close()
|
sock.close()
|
||||||
except (ssl.SSLError, socket.error, httplib.BadStatusLine), errMsg:
|
except (ssl.SSLError, socket.error, httplib.BadStatusLine), ex:
|
||||||
self._tunnel_host = None
|
self._tunnel_host = None
|
||||||
logger.debug("SSL connection error occurred ('%s')" % errMsg)
|
logger.debug("SSL connection error occurred ('%s')" % ex.message)
|
||||||
|
|
||||||
# Reference(s): https://docs.python.org/2/library/ssl.html#ssl.SSLContext
|
# Reference(s): https://docs.python.org/2/library/ssl.html#ssl.SSLContext
|
||||||
# https://www.mnot.net/blog/2014/12/27/python_2_and_tls_sni
|
# https://www.mnot.net/blog/2014/12/27/python_2_and_tls_sni
|
||||||
|
@ -75,9 +75,9 @@ class HTTPSConnection(httplib.HTTPSConnection):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
sock.close()
|
sock.close()
|
||||||
except (ssl.SSLError, socket.error, httplib.BadStatusLine), errMsg:
|
except (ssl.SSLError, socket.error, httplib.BadStatusLine), ex:
|
||||||
self._tunnel_host = None
|
self._tunnel_host = None
|
||||||
logger.debug("SSL connection error occurred ('%s')" % errMsg)
|
logger.debug("SSL connection error occurred ('%s')" % ex.message)
|
||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
raise SqlmapConnectionException("can't establish SSL connection")
|
raise SqlmapConnectionException("can't establish SSL connection")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user