Under very specific circumstances, requests will use pyOpenSSL:
2.24.0 (2020-06-17)
pyOpenSSL TLS implementation is now only used if Python either doesn't have an ssl module or doesn't support SNI. Previously pyOpenSSL was unconditionally used if available. This applies even if pyOpenSSL is installed via the requests[security]
— https://github.com/psf/requests/blob/master/HISTORY.md#2240-2020-06-17
We have at least two places in the codebase where this is significant.
It would be great to update .github/workflows/build.yml so that there’s also an environment where pyopenssl is guaranteed to be loaded by requests. That would catch errors like this one.
Under very specific circumstances,
requests
will usepyOpenSSL
:We have at least two places in the codebase where this is significant.
1. different error types are used
https://github.com/jakubroztocil/httpie/blob/49e71d252f54871a6bc49cb1cba103d385a543b8/tests/test_ssl.py#L10-L22
2. difference messages are used (despite the comment incorrectly talking about differences in architectures):
https://github.com/jakubroztocil/httpie/blob/49e71d252f54871a6bc49cb1cba103d385a543b8/tests/test_ssl.py#L136-L141
It would be great to update .github/workflows/build.yml so that there’s also an environment where
pyopenssl
is guaranteed to be loaded byrequests
. That would catch errors like this one.