Disable InsecureRequestWarning if SSL verify is False

If checking of HTTPS validity is disable, turn off the warning that it 
has been disabled since we have done so explicitly.
This commit is contained in:
Landon Abney
2018-06-16 22:23:32 -07:00
parent 00f4bf26a9
commit 7b0cc2d2a9

View File

@ -59,6 +59,10 @@ sess.verify = False # '/path/to/certfile'
# If verify is set to a path to a directory, # If verify is set to a path to a directory,
# the directory must have been processed using the c_rehash utility supplied # the directory must have been processed using the c_rehash utility supplied
# with OpenSSL. # with OpenSSL.
if sess.verify is False:
# Disable the warning that the request is insecure, we know that...
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
SELECTOR = ['stream', 'allStreams'] SELECTOR = ['stream', 'allStreams']