From e41ef69663c66e9c5ed810a07bed40b030eee1f9 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 11 May 2016 11:37:19 -0700 Subject: [PATCH] Handle SNIMissingWarning requests exception Change-Id: I7e0bae3732d3cb22cbc9d3041a625635f7d61c4f --- gertty/app.py | 2 ++ gertty/requestsexceptions.py | 8 ++++++++ 2 files changed, 10 insertions(+) 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