From a53efe1705329ca27ecfd937cb2671c6bef404b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Tue, 28 Jun 2016 16:44:58 +0200 Subject: [PATCH] Respect the transport_schema when constructing host --- elasticsearch/connection/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elasticsearch/connection/base.py b/elasticsearch/connection/base.py index e97d6169..cf4fd67f 100644 --- a/elasticsearch/connection/base.py +++ b/elasticsearch/connection/base.py @@ -33,7 +33,9 @@ class Connection(object): :arg url_prefix: optional url prefix for elasticsearch :arg timeout: default timeout in seconds (float, default: 10) """ - scheme = 'https' if use_ssl else 'http' + scheme = self.transport_schema + if use_ssl: + scheme += 's' self.host = '%s://%s:%s' % (scheme, host, port) if url_prefix: url_prefix = '/' + url_prefix.strip('/')