elasticsearch/elasticsearch-py — pull request #1 by nkvoll (2013-09-24 19:54:54+00:00)
Title: Support for Basic Authentication and HTTPS

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.