Conversation
This avoids incompatibilities with older versions of OpenSSL and errors like this:
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
ttung
left a comment
There was a problem hiding this comment.
This wasn't an explicit requirement before, right? Why is it now?
Codecov Report
@@ Coverage Diff @@
## master #102 +/- ##
=======================================
Coverage 87.93% 87.93%
=======================================
Files 29 29
Lines 970 970
=======================================
Hits 853 853
Misses 117 117Continue to review full report at Codecov.
|
|
PyOpenSSL is an optional transitive requirement of requests. It always tries to import and use pyOpenSSL instead of the native Python OpenSSL bindings, but silently proceeds if that import fails. On Python < 2.7.9 or so, SNI is not supported by the native Python OpenSSL bindings. There are other issues with it as well. That's why it tries to do that. PyOpenSSL < 16.2.0 induces this crash when loading OpenSSL 1.1.x. So basically if pyOpenSSL is present, we need it to be up to date. https://github.com/requests/requests/blob/master/requests/__init__.py#L93-L102 |
This avoids incompatibilities with older versions of OpenSSL and errors like this: