diff --git a/elasticsearch/connection/http_urllib3.py b/elasticsearch/connection/http_urllib3.py index 6c9d6996e9..fd657c9b78 100644 --- a/elasticsearch/connection/http_urllib3.py +++ b/elasticsearch/connection/http_urllib3.py @@ -80,8 +80,8 @@ def __init__(self, host='localhost', port=9200, http_auth=None, kw = {} # if providing an SSL context, raise error if any other SSL related flag is used - if ssl_context and (verify_certs or ca_certs or ssl_version): - raise ImproperlyConfigured("When using `ssl_context`, `use_ssl`, `verify_certs`, `ca_certs` and `ssl_version` are not permitted") + if ssl_context and (ca_certs or ssl_version or use_ssl): + raise ImproperlyConfigured("When using `ssl_context`, `use_ssl`, `ca_certs` and `ssl_version` are not permitted") # if ssl_context provided use SSL by default if use_ssl or ssl_context: diff --git a/test_elasticsearch/test_connection.py b/test_elasticsearch/test_connection.py index bdb94add94..8dc705e36d 100644 --- a/test_elasticsearch/test_connection.py +++ b/test_elasticsearch/test_connection.py @@ -68,7 +68,6 @@ def test_ssl_context_and_depreicated_values(self): except AttributeError: raise SkipTest("SSL Context not supported in this version of python") self.assertRaises(ImproperlyConfigured, Urllib3HttpConnection, ssl_context=ctx, use_ssl=True) - self.assertRaises(ImproperlyConfigured, Urllib3HttpConnection, ssl_context=ctx, verify_certs=True) self.assertRaises(ImproperlyConfigured, Urllib3HttpConnection, ssl_context=ctx, ca_certs="/some/path/to/cert.crt") self.assertRaises(ImproperlyConfigured, Urllib3HttpConnection, ssl_context=ctx, ssl_version=ssl.PROTOCOL_SSLv23)