Get the latest tech news
Patching requests for fun and (concurrent) profit
Because life is too short to spam calls to <code>SSL_CTX_load_verify_locations()</code>.
In the first case, a full 0.68 seconds are spent in the load_verify_locations() function of the ssl module, which configures a SSLContext object to use a set of root CA certificates for validation. In scenarios with a higher concurrency, we have also observed some global blocking going on, either because each FFI call locks up the GIL or because of some thread safety mechanisms in OpenSSL itself. A small caveat happens when verify isn't a boolean, but rather a string indicating a path to an alternative CA bundle or cert store.
Or read this on Hacker News