urllib3 1.25 breaks ssl verification when verify_certs=False
See original GitHub issueOur 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:
- Created 4 years ago
- Reactions:3
- Comments:7 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@HonzaKral - is the fix going to be backported to the ES6 branch of this package?
I had the problem here, the only fix was to downgrade to 1.24.2 to make urllib3 ignore certificate verification