diff --git a/elasticsearch/connection/http_requests.py b/elasticsearch/connection/http_requests.py index ce079654..f9b6efd2 100644 --- a/elasticsearch/connection/http_requests.py +++ b/elasticsearch/connection/http_requests.py @@ -106,7 +106,6 @@ class RequestsHttpConnection(Connection): if not ssl_show_warn: requests.packages.urllib3.disable_warnings() - self.ssl_show_warn = ssl_show_warn if self.use_ssl and not verify_certs and ssl_show_warn: warnings.warn( "Connecting to %s using SSL with verify_certs=False is insecure." diff --git a/elasticsearch/connection/http_urllib3.py b/elasticsearch/connection/http_urllib3.py index 52755f00..90292852 100644 --- a/elasticsearch/connection/http_urllib3.py +++ b/elasticsearch/connection/http_urllib3.py @@ -196,6 +196,9 @@ class Urllib3HttpConnection(Connection): "Connecting to %s using SSL with verify_certs=False is insecure." % host ) + if not ssl_show_warn: + urllib3.disable_warnings() + self.pool = pool_class( host, port=port, timeout=self.timeout, maxsize=maxsize, **kw