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.

How to disable SSL certificate verification in Python?

See original GitHub issue

I have read the docs up and down and I can’t seem to find a reference for disabling SSL certificate verification. As of right now, I currently have a project where I am doing an intentional man-in-the-middle attack to switch proxies on need-bases.

client <-> Proxy Switcher (server acting as proxy)
Proxy Switcher (emulated client) <-> Exchanges

On the return of anything but a 200, the proxy switcher automatically switches proxy and try again. A man-in-the-middle is needed to verify that the HTTPS requests are coming back with the proper headers, and this part seems to work fine. However, communicating between the client and proxy switcher seems to be returning back (expected) SSL certificate issues, as proxy switcher automatically generates its own local certificate. This, though, I would like to disable.

Without adding the certificate to my local trust env, I receive the error:

(Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

Which is warranted, but would be best if could be disabled by some exchange flag. When adding the certificate to my local trust env, I receive the error

(Caused by SSLError(SSLCertVerificationError("hostname 'pro.coinbase.com' doesn't match 'Felipes-MacBook-Pro.local'")))

Which is also warranted, but a check I would much rather disable. Any help would be appreciated. My idea would be something simple as:

ex = getattr(ccxt, exchange)(
    {
        "session": cfscrape.create_scraper(),
        "enableRateLimit": False,
        "verify_ssl_certificates": False,
    }
)

Note: I have tried the verify flag with no success.

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
kroitorcommented, Jun 29, 2019
2reactions
synchronizingcommented, Jun 29, 2019

Sounds good – will give it a try, thank you again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I disable the security certificate check in Python requests
Use requests.packages.urllib3.disable_warnings() and verify=False on requests methods ...
Read more >
How to disable security certificate checks for requests in Python
How to disable security certificate checks for requests in Python · Method 1: Passing verify=False to request method · Python3 · Python3 ·...
Read more >
python requests: How to ignore invalid SSL certificates
python requests: How to ignore invalid SSL certificates · Error · Traceback · Solution · Catching the Exception · Suppress InsecureRequestWarning.
Read more >
Python Requests: Disable SSL validation - techtutorialsx
In this tutorial we will learn how to disable SSL validation using Python Requests library. SSL validation is of extreme importance due to ......
Read more >
How to Disable Security Certificate Checks for Requests in ...
Summary: You can disable security certificate checks for requests in Python in two ways: (i) Using Session.verify as False (ii) Setting verify =...
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