question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is absen optino: ssl_certificate_verification

See original GitHub issue

For connection to ES need add option ssl_certificate_verification(true/false). Now when ES use self singin cacert there is ssl connection error.

    if options['ca_certs']:
        es_client = Elasticsearch(es_cluster,
                                  verify_certs=True,
                                  ca_certs=options['ca_certs'],
                                  client_cert=options['client_cert'],
                                  client_key=options['client_key'],
                                  headers=options['header'],
                                  http_auth=http_auth)
    else:
        es_client = Elasticsearch(es_cluster,
                                  verify_certs=False,
                                  headers=options['header'],
                                  http_auth=http_auth)

and need disable host_verification .

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
braedoncommented, Feb 28, 2021

Can you post the exact logs you get when running that command with the original code (i.e. verify_certs=True)?

What happens if you run:

--log-level DEBUG -e https://elasticsearch:9200 --basic-password password --basic-user user --cluster-health-disable --nodes-stats-disable --indices-mappings-disable --indices-stats-disable

i.e. remove the --ca-certs option, which should disable verify_certs.

Were your instance certs generated with IPs or DNS names? i.e. were the --ip and/or --dns options of the elasticsearch-certutil cert command specified?

0reactions
braedoncommented, Jul 2, 2021

Hi @zakabluk,

As stated above, my best guess for how to connect to a cluster that has HTTPS enabled but doesn’t have correctly configured certificates is to use a HTTPS URL without any --ca-certs.

For a self-signed cluster, you should be able to just specify a HTTPS URL in --es-cluster, and not specify --ca-certs - that should use a HTTPS connection, but set verify_certs=False (i.e. use the else block in the code you posted).

What happens if you run:

--log-level DEBUG -e https://elasticsearch:9200 --basic-password password --basic-user user --cluster-health-disable --nodes-stats-disable --indices-mappings-disable --indices-stats-disable

i.e. remove the --ca-certs option, which should disable verify_certs.

I don’t know if this works or not, as I don’t have access to your cluster, and don’t have enough information about your cluster to replicate (nor do I have the time to do so).

As previously requested, if this doesn’t work, please post the resulting logs so I can see what is happening.

Otherwise, I’d suggest configuring your cluster with SSL certificates that can pass hostname verification - i.e. set --ip and/or --dns.

Read more comments on GitHub >

github_iconTop Results From Across the Web

openssl-verification-options
The Netscape certificate type must be absent or it must have the SSL CA bit set. This is used as a work around...
Read more >
javax.net.ssl.SSLHandshakeException - Stack Overflow
I am currently using a self created self-signed certificate in development environment. And hence it is bound to show up the issue. Question....
Read more >
Validating certificates - Forcepoint
1. Go to Configure > SSL > Validation > General. · 2. Enable the certificate verification engine: This option enables and disables the...
Read more >
SSL built-in actions and user-defined actions
You can set client certificate verification to mandatory or option when you have configured policy based client authentication.
Read more >
Documentation: 15: 34.19. SSL Support - PostgreSQL
The SSL connection will fail if the server certificate cannot be verified. verify-full is recommended in most security-sensitive environments.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found