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.

urllib3 1.25 breaks ssl verification when verify_certs=False

See original GitHub issue

Our code:

Elasticsearch(os.environ['ELASTICSEARCH_URL'],
                             verify_certs=False, timeout=60)

When our underlying pip3 package of urllib3 is at 1.24.2, the above works great.

When we use urllib3 1.25, it breaks with the following error:

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)

Considering that urllib3 changed the way that SSL verification works by default in 1.25, I suspect that either Elasticsearch isn’t correctly passing verify_certs=False to urllib3, or urllib3 isn’t honoring it, or something…

I don’t know for sure if this is an elasticsearch-py problem or a urllib3 problem, but since my goal is to use Elasticsearch, I figured I should start here. Thanks.

OS: Debian Stretch, in a docker container Python: 3.5.3 Elasticsearch python package: 7.0.0 Elasticsearch server: 6.2, using AWS’s managed Elasticsearch service

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
vtermaniscommented, Jan 27, 2020

@HonzaKral - is the fix going to be backported to the ES6 branch of this package?

1reaction
jolyjcommented, Sep 14, 2019

I had the problem here, the only fix was to downgrade to 1.24.2 to make urllib3 ignore certificate verification

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Usage — urllib3 1.25.10 documentation
Follow the certificate verification guide to resolve this warning. InsecurePlatformWarning: This happens on Python 2 platforms that have an outdated ssl module.
Read more >
python - urllib and "SSL: CERTIFICATE_VERIFY_FAILED" Error
There is nothing wrong with the URL and it can be successfully verified with the common trusted certificates. So you should better not...
Read more >
Connecting to %s using SSL with verify_certs=False is insecure
Here is my python code for connecting to Elasticsearch: from elasticsearch import Elasticsearch es = Elasticsearch([HOST], http_auth = (str(USERNAME), ...
Read more >
Solve the dreadful certificate issues in Python requests module
(Caused by SSLError(SSLCertVerification(1, '[SSL: CERTIFICATE_VERIFY_FAILED] ... My first try was to use the verify flag as False and try.
Read more >
Certificate verification in Python standard library HTTP clients
The ssl module now checks the PYTHONHTTPSVERIFY environment variable - if set, its value overrides the settings from cert-verification.cfg . The ...
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