Handle SNIMissingWarning requests exception

Change-Id: I7e0bae3732d3cb22cbc9d3041a625635f7d61c4f
This commit is contained in:
James E. Blair 2016-05-11 11:37:19 -07:00
parent 6f68c58224
commit e41ef69663
2 changed files with 10 additions and 0 deletions

View File

@ -725,6 +725,8 @@ class App(object):
# nearly un-actionable.
if category == requestsexceptions.InsecurePlatformWarning:
return
if category == requestsexceptions.SNIMissingWarning:
return
# Disable InsecureRequestWarning when certificate validation is disabled
if not self.config.verify_ssl:
if category == requestsexceptions.InsecureRequestWarning:

View File

@ -27,3 +27,11 @@ except ImportError:
from urllib3.exceptions import InsecureRequestWarning
except ImportError:
InsecureRequestWarning = None
try:
from requests.packages.urllib3.exceptions import SNIMissingWarning
except ImportError:
try:
from urllib3.exceptions import SNIMissingWarning
except ImportError:
SNIMissingWarning = None