How to disable SSL certificate verification in Python?
See original GitHub issueI 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:
- Created 4 years ago
- Comments:51 (51 by maintainers)
Top GitHub Comments
https://travis-ci.org/ccxt/ccxt/builds
Sounds good – will give it a try, thank you again.