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.

SSL errors when testing certain HTTPS sites

See original GitHub issue

I’m getting SSL errors sometimes when using certain HTTPS sites using locust:

In [26]: u
Out[26]: <locust.core.HttpLocust at 0x104f94cd0>

In [27]: u.host
Out[27]: 'https://www.dodopal.com'

In [28]: res = u.client.get('/'); res.__dict__
Out[28]: 
{'_content': None,
 '_content_consumed': True,
 'cookies': <RequestsCookieJar[]>,
 'elapsed': datetime.timedelta(0),
 'encoding': None,
 'error': requests.exceptions.SSLError(requests.packages.urllib3.exceptions.SSLError(ssl.SSLError(1,
                                                                                         u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'))),
 'headers': {},
 'history': [],
 'raw': None,
 'reason': None,
 'request': <PreparedRequest [GET]>,
 'status_code': 0,
 'url': None}

Other sites seem to be fine:

In [35]: u.host = 'https://www.eff.org'

In [36]: u.client.get('/')
Out[36]: <Response [200]>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
Anup-Deo21commented, Jun 28, 2016

How to get rid from “SSL: CERTIFICATE_VERIFY_FAILED” Error

On Windows, Python does not look at the system certificate, it uses its own located at ?\lib\site-packages\certifi\cacert.pem.

The solution to your problem:

  1. download the domain validation certificate as *.crt or *pem file
  2. open the file in editor and copy it’s content to clipboard
  3. find your cacert.pem location: from requests.utils import DEFAULT_CA_BUNDLE_PATH; print(DEFAULT_CA_BUNDLE_PATH)
  4. edit the cacert.pem file and paste your domain validation certificate at the end of the file.
  5. Save the file and enjoy requests!
1reaction
mjohnson767commented, Mar 18, 2020

I’m not sure what this means: “paste your domain validation certificate at the end of the file”. When I open my domain.crt up in notepad it’s all encrypted. 0‚0‚ ]º–l á“GèaÜ. That’s what I’d be adding to the locust pem file. Can I get some clarification on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Simple Explanation of SSL Certificate Errors & How to Fix ...
An SSL certificate error occurs when a web browser can't verify the SSL certificate installed on a site. Rather than connect users to...
Read more >
8 Ways to Fix SSL Connection Errors on Various Browsers ...
Open the Chrome browser and access its Settings menu. · Go to Privacy and security. · Tap on Clear browsing data. · Select...
Read more >
What Do SSL Certificate Errors Mean: Causes & How to Fix ...
7. Untrusted Certificate Authority. This error means that the browser cannot find the root certificate in the local trusted certificate store. ...
Read more >
HTTP Server Test Fails with SSL Error
On the Test Settings page, select the HTTP server test or page load test, and uncheck the Verify SSL certificate box under the...
Read more >
FIX: Certificate error when you try to visit an SSL Web site by ...
This issue occurs if the SSL Web site that you try to visit is located in a zone that has more restricted permissions...
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