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"),

        print('Nao conectado')
    return es

Ohhh apologies yes

verify_certs=False looks correct

What version client?
What version Elasticsearch?

Can you just try the simple form version

client = Elasticsearch(
    basic_auth=("user", "password"),


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