Connecting an ES client with a kibana on Python

Many thanks

Oh, Stephen... Everything worked out!!! Finally!
I've been in agony since these 6 days. I have constant problems with ensuring that the middleware for my projects is working properly.
The funny thing about this story is that yesterday I tried to set up security (yes, it was already set up automatically without me). Everything broke down for me, so I had to put elatsik and kibana on a new one. I lost 4.5 hours on this. This is terrible

I am grateful for your help

The final version

With safety turned on in the elasticsearch.yml:

# Enable security features
xpack.security.enabled: true

xpack.security.enrollment.enabled: true

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12

In my case, this setting worked:

es = AsyncElasticsearch(
    hosts='https://localhost:9200',
    basic_auth=('elastic', 'password'),
    ca_certs='C:/Users/User/Desktop/elasticsearch-8.15.4/config/certs/http_ca.crt'
)

The same is true for the synchronous version of the ES client

1 Like