diff --git a/gertty/app.py b/gertty/app.py index 447399e..571327a 100644 --- a/gertty/app.py +++ b/gertty/app.py @@ -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: diff --git a/gertty/requestsexceptions.py b/gertty/requestsexceptions.py index aefb002..1a6d335 100644 --- a/gertty/requestsexceptions.py +++ b/gertty/requestsexceptions.py @@ -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