Added docs on SSL and auth options
This commit is contained in:
@@ -78,6 +78,7 @@ The client's features include:
|
|||||||
* load balancing (with pluggable selection strategy) across all available nodes
|
* load balancing (with pluggable selection strategy) across all available nodes
|
||||||
* failed connection penalization (time based - failed connections won't be
|
* failed connection penalization (time based - failed connections won't be
|
||||||
retried until a timeout is reached)
|
retried until a timeout is reached)
|
||||||
|
* support for ssl and http authentication
|
||||||
* thread safety
|
* thread safety
|
||||||
* pluggable architecture
|
* pluggable architecture
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,44 @@ Some example configurations::
|
|||||||
es = Elasticsearch(["seed1", "seed2"], sniff_on_start=True, sniff_on_connection_fail=True, sniffer_timeout=60)
|
es = Elasticsearch(["seed1", "seed2"], sniff_on_start=True, sniff_on_connection_fail=True, sniffer_timeout=60)
|
||||||
|
|
||||||
|
|
||||||
|
SSL and Authentication
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
You can configure the client to use ``SSL`` for connecting to your
|
||||||
|
elasticsearch cluster, including certificate verification and http auth::
|
||||||
|
|
||||||
|
from elasticsearch import Elasticsearch
|
||||||
|
|
||||||
|
# you can use RFC-1738 to specify the url
|
||||||
|
es = Elasticsearch(['https://user:secret@localhost:443'])
|
||||||
|
|
||||||
|
# ... or specify common parameters as kwargs
|
||||||
|
|
||||||
|
# use certifi for CA certificates
|
||||||
|
import certifi
|
||||||
|
|
||||||
|
es = Elasticsearch(
|
||||||
|
['localhost', 'otherhost'],
|
||||||
|
http_auth=('user', 'secret'),
|
||||||
|
port=443,
|
||||||
|
use_ssl=True,
|
||||||
|
verify_certs=True,
|
||||||
|
ca_certs=certifi.where(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
By default SSL certificates won't be verified, pass in
|
||||||
|
``verify_certs=True`` to make sure your certificates will get verified. The
|
||||||
|
client doesn't ship with any CA certificates; easiest way to obtain the
|
||||||
|
common set is by using the `certify`_ package (as shown above).
|
||||||
|
|
||||||
|
See class :class:`~elasticsearch.Urllib3HttpConnection` for detailed
|
||||||
|
description of the options.
|
||||||
|
|
||||||
|
.. _certifi: http://certifi.io/
|
||||||
|
|
||||||
Logging
|
Logging
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user