Connecting to elastic

Hi guys, i have some doubt about connecting elasticsearch on python, is it really needed to have ca_certs? i have tried to use verify_certs=False but i'm getting an error, in this case is SSLError([SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1002))

Hi @Guilhermitos

Welcome to the community.

Please share your connection code

verify_certs=False < Correct / Corrected

Pretty sure it a lower case false

from elasticsearch import Elasticsearch
def connect_elasticsearch():

    es = Elasticsearch(

        [{'host': 'XXXXXX', 'port':XXXX, 'scheme':'https'}],
        basic_auth=("USER", "PASSWORD"),
        verify_certs=False
    )

    if es.ping():
        print('Conectado')
    else:
        print('Nao conectado')
    return es
connect_elasticsearch()

Ohhh apologies yes

verify_certs=False looks correct

What version client?
What version Elasticsearch?

Can you just try the simple form version

client = Elasticsearch(
    "https://localhost:9200",
    basic_auth=("user", "password"),
    verify_certs=False

)

And to make sure, are you sure your cluster is running on HTTPS?

Can you curl from where the python client is to elasticsearch?

curl -k -v -u user https://host:port

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.