From 125be4bfd47f3523bad9502d21010a39694e99da Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 30 Dec 2023 14:44:35 +0200 Subject: [PATCH] urllib3 v2.0 only supports OpenSSL 1.1.1+ // Issue #4614 --- setup.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup.py b/setup.py index 46716cc507..bdb10a319b 100644 --- a/setup.py +++ b/setup.py @@ -30,6 +30,19 @@ if platform.system() == "Darwin" and "arm" in platform.machine().lower(): __install_requires__.append("chardet>=3.0.2,<4") +# issue 4614: urllib3 v2.0 only supports OpenSSL 1.1.1+ +try: + import ssl + + if ssl.OPENSSL_VERSION.startswith("OpenSSL ") and ssl.OPENSSL_VERSION_INFO < ( + 1, + 1, + 1, + ): + __install_requires__.append("urllib3<2") +except ImportError: + pass + setup( name=__title__,