Hi Elastic Community,
We are having problems trying to connect a python (2.7.5) client to Elasticsearch 8.1 (with security enabled).
We have tried the following example code:
from elasticsearch import Elasticsearch
from es_pandas import es_pandas
# Password for the 'elastic' user generated by Elasticsearch
ELASTIC_PASSWORD = "s4cCzeuWasAu7l_n9tph"
# Create the client instance
#The ca_certs file is from elasticsearch server (<elastic>/config/certs/http_ca.crt).
client = Elasticsearch(
"https://10.162.18.239:9200",
ca_certs="/opt/pythonclient/certs/http_ca.crt",
basic_auth=("elastic", ELASTIC_PASSWORD)
)
client.info()
The error is:
elasticsearch.exceptions.AuthenticationException: AuthenticationException(401, 'security_exception', 'missing authentication credentials for REST request [/]')
Any suggestions on how to set the credentials?
Regards
Aldo Fiorentini