diff --git a/httpie/ssl_.py b/httpie/ssl_.py index af5ca548..33fde598 100644 --- a/httpie/ssl_.py +++ b/httpie/ssl_.py @@ -48,6 +48,13 @@ class HTTPieHTTPSAdapter(HTTPAdapter): ssl_version=ssl_version, ciphers=ciphers, ) + # workaround for a bug in requests 2.32.3, see: + # https://github.com/httpie/cli/issues/1583 + if getattr(self._ssl_context, 'load_default_certs', None) is not None: + # if load_default_certs is present, get_ca_certs must be + # also, no need for another getattr + if not self._ssl_context.get_ca_certs(): + self._ssl_context.load_default_certs() super().__init__(**kwargs) def init_poolmanager(self, *args, **kwargs): diff --git a/setup.cfg b/setup.cfg index 37663393..85490981 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,7 +50,7 @@ install_requires = pip charset_normalizer>=2.0.0 defusedxml>=0.6.0 - requests[socks] >=2.22.0, <=2.31.0 + requests[socks] >=2.22.0 Pygments>=2.5.2 requests-toolbelt>=0.9.1 multidict>=4.7.0