Skip to content

Conversation

nkvoll
Copy link
Member

@nkvoll nkvoll commented Sep 24, 2013

Many people use Elasticsearch over unsecured networks that requires encryption and authentication.

Added support for connecting to HTTPS servers and authenticating via basic auth.

from elasticsearch import Elasticsearch

dc = Elasticsearch(["secure-server.com:443"], transport_schema='https', auth='user:password')
dc.search()

from elasticsearch.connection.http import RequestsHttpConnection

rc = Elasticsearch(["secure-server.com:443"], transport_schema='https', auth='user:password', connection_class=RequestsHttpConnection)
rc.search()

Theres a few failing tests on test_elasticsearch.test_connection.TestRequestsConnection, which is caused by the mock object used in the tests not being set up to handle actually being merged with the session config.

If this is an acceptable API, the tests can of course be fixed, but awaiting feedback before spending time on it.

@honzakral
Copy link
Contributor

This has been fixed in 7a440fd and b724288

Thanks for the patch, I used a lot of the code.

@honzakral honzakral closed this Sep 24, 2013
@nkvoll
Copy link
Member Author

nkvoll commented Sep 24, 2013

That's great! As you're part of the Elasticsearch team, is a similar change possible for the rest of the clients (ruby/php/perl) too? I'm sure their users would benefit from https and auth support as well, and if the APIs could be kept similar, that's an obvious benefit :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants