After enabling Xpack and setting SSL/TSL for a single node and username and password, i am trying to index a single data point
from elasticsearch import Elasticsearch
from datetime import datetime
es = Elasticsearch(
['server'],
http_auth=('user', 'password'),
scheme="https",
port=9200,
)
doc = {
'author': 'kimchy',
'text': 'Elasticsearch: cool. bonsai cool.',
'timestamp': datetime.now(),
}
res = es.index(index="test-index", id=1, body=doc)
and i get
SSLError: ConnectionError([SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076)) caused by: SSLError([SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076))
my SSL version in python and server match. The terminal commands below return the same values
python -c "import ssl; print(ssl.OPENSSL_VERSION)"
openssl version
i tried a variety of settings based on online research such as
from elasticsearch import RequestsHttpConnection
es = Elasticsearch("https://user:password@server:9200")
es = Elasticsearch("https://user:password@server:9200", ca_certs=False, verify_certs=False)
es = Elasticsearch(["server"], port=9200, connection_class=RequestsHttpConnection, http_auth=('user', 'password'), use_ssl=True, verify_certs=False)