httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
33.9k stars 3.68k forks source link

Add a build environment where `pyOpenSSL` is active #939

Closed jkbrzt closed 3 years ago

jkbrzt commented 4 years ago

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.

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 by requests. That would catch errors like this one.

gmelodie commented 4 years ago

Hey! I'll give this a go :)

jkbrzt commented 4 years ago

Awesome!