0

I am dealing with ElasticSearch library on Python and at some point I need to implement on some Elastic Server. My connection attempts always fail with error InsecureRequestWarning: Unverified HTTPS request is being made to host.

client=Elasticsearch(
    hosts=["https:/something:something@servername:9200"],
    use_ssl=True,
    verify_certs=True,
    ca_certs="some-cert"
)
whyt
  • 1
  • 3
  • 1
    Does this answer your question? [Suppress InsecureRequestWarning: Unverified HTTPS request is being made in Python2.6](https://stackoverflow.com/questions/27981545/suppress-insecurerequestwarning-unverified-https-request-is-being-made-in-pytho) – svfat Dec 12 '22 at 18:25
  • ...except that ideally you don't want to *suppress* the warning; you want to configure certificate verification correctly so that the certificate is trusted. – larsks Dec 12 '22 at 19:06

1 Answers1

0

You can set verify_certs to False if you want to disable verification. Or you can set up a CA, or simply get a free SSL certificate from a widely supported CA if you own a domain name. Also, please share the version of elasticsearch you are using as it was deprecated. You can get more https://github.com/elastic/elasticsearch-py/issues/712 this link once.

BruceWayne
  • 23
  • 6