From 7bc190642c24dfb4427f2512ba1bf19ae433c95d Mon Sep 17 00:00:00 2001 From: Moshe Zada Date: Fri, 8 Nov 2019 11:25:22 +0200 Subject: [PATCH] Accept scheme=https in constructor --- elasticsearch_async/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elasticsearch_async/connection.py b/elasticsearch_async/connection.py index 6d3c912..c3bf697 100644 --- a/elasticsearch_async/connection.py +++ b/elasticsearch_async/connection.py @@ -16,7 +16,7 @@ class AIOHttpConnection(Connection): def __init__(self, host='localhost', port=9200, http_auth=None, use_ssl=False, verify_certs=False, ca_certs=None, client_cert=None, client_key=None, loop=None, use_dns_cache=True, headers=None, - ssl_context=None, **kwargs): + ssl_context=None, scheme=None, **kwargs): super().__init__(host=host, port=port, **kwargs) self.loop = asyncio.get_event_loop() if loop is None else loop @@ -35,7 +35,7 @@ def __init__(self, host='localhost', port=9200, http_auth=None, if ssl_context and (verify_certs or ca_certs): raise ImproperlyConfigured("When using `ssl_context`, `use_ssl`, `verify_certs`, `ca_certs` are not permitted") - if use_ssl or ssl_context: + if use_ssl or ssl_context or scheme == 'https': cafile = ca_certs if not cafile and not ssl_context and verify_certs: # If no ca_certs and no sslcontext passed and asking to verify certs