Use use ssl_context or don't but don't mix (#714)

* Use original SSL process and add SSLContext

Not going to deprecate and replace with SSLContext.
But instead give option for using SSLContext next to the original way of
handling SSL.
This commit is contained in:
Nick Lang
2018-03-04 15:09:40 -08:00
committed by GitHub
parent 4438ea75a1
commit 058d38f0ae
5 changed files with 71 additions and 63 deletions
+2 -2
View File
@@ -97,9 +97,9 @@ Elastic Cloud (and SSL) use-case::
Using SSL Context with a self-signed cert use-case::
>>> from elasticsearch import Elasticsearch
>>> from elasticsearch.connection import create_ssl_context
>>> from ssl import create_default_context
>>> context = create_ssl_context(cafile="path/to/cafile.pem")
>>> context = create_default_context(cafile="path/to/cafile.pem")
>>> es = Elasticsearch("https://elasticsearch.url:port", ssl_context=context, http_auth=('elastic','yourpassword'))
>>> es.info()