Disable urllib3 warningns if not ssl_show_warn
This commit is contained in:
@@ -106,7 +106,6 @@ class RequestsHttpConnection(Connection):
|
|||||||
if not ssl_show_warn:
|
if not ssl_show_warn:
|
||||||
requests.packages.urllib3.disable_warnings()
|
requests.packages.urllib3.disable_warnings()
|
||||||
|
|
||||||
self.ssl_show_warn = ssl_show_warn
|
|
||||||
if self.use_ssl and not verify_certs and ssl_show_warn:
|
if self.use_ssl and not verify_certs and ssl_show_warn:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"Connecting to %s using SSL with verify_certs=False is insecure."
|
"Connecting to %s using SSL with verify_certs=False is insecure."
|
||||||
|
|||||||
@@ -196,6 +196,9 @@ class Urllib3HttpConnection(Connection):
|
|||||||
"Connecting to %s using SSL with verify_certs=False is insecure."
|
"Connecting to %s using SSL with verify_certs=False is insecure."
|
||||||
% host
|
% host
|
||||||
)
|
)
|
||||||
|
if not ssl_show_warn:
|
||||||
|
urllib3.disable_warnings()
|
||||||
|
|
||||||
|
|
||||||
self.pool = pool_class(
|
self.pool = pool_class(
|
||||||
host, port=port, timeout=self.timeout, maxsize=maxsize, **kw
|
host, port=port, timeout=self.timeout, maxsize=maxsize, **kw
|
||||||
|
|||||||
Reference in New Issue
Block a user