Skip to content

Commit a53efe1

Browse files
committed
Respect the transport_schema when constructing host
1 parent a359c5f commit a53efe1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

elasticsearch/connection/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def __init__(self, host='localhost', port=9200, use_ssl=False, url_prefix='', ti
3333
:arg url_prefix: optional url prefix for elasticsearch
3434
:arg timeout: default timeout in seconds (float, default: 10)
3535
"""
36-
scheme = 'https' if use_ssl else 'http'
36+
scheme = self.transport_schema
37+
if use_ssl:
38+
scheme += 's'
3739
self.host = '%s://%s:%s' % (scheme, host, port)
3840
if url_prefix:
3941
url_prefix = '/' + url_prefix.strip('/')

0 commit comments

Comments
 (0)