Browse Source

Handle SNIMissingWarning requests exception

Change-Id: I7e0bae3732d3cb22cbc9d3041a625635f7d61c4f
changes/91/391991/1
James E. Blair 5 years ago
parent
commit
e41ef69663
2 changed files with 10 additions and 0 deletions
  1. +2
    -0
      gertty/app.py
  2. +8
    -0
      gertty/requestsexceptions.py

+ 2
- 0
gertty/app.py 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:


+ 8
- 0
gertty/requestsexceptions.py 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

Loading…
Cancel
Save