Blame patch-requests-certs.py-to-use-the-system-CA-bundle.patch

42ab4cc
From fd9ab446d8479360d2c1c8252508d97d58ed3e0e Mon Sep 17 00:00:00 2001
2c9580b
From: Jeremy Cline <jeremy@jcline.org>
2c9580b
Date: Mon, 19 Jun 2017 16:09:02 -0400
2c9580b
Subject: [PATCH] Patch requests/certs.py to use the system CA bundle
2c9580b
2c9580b
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
2c9580b
---
2c9580b
 requests/certs.py | 11 ++++++++++-
42ab4cc
 setup.py          |  1 -
42ab4cc
 2 files changed, 10 insertions(+), 2 deletions(-)
2c9580b
2c9580b
diff --git a/requests/certs.py b/requests/certs.py
2c9580b
index d1a378d..7b103ba 100644
2c9580b
--- a/requests/certs.py
2c9580b
+++ b/requests/certs.py
2c9580b
@@ -11,8 +11,17 @@ only one — the one from the certifi package.
2c9580b
 If you are packaging Requests, e.g., for a Linux distribution or a managed
2c9580b
 environment, you can change the definition of where() to return a separately
2c9580b
 packaged CA bundle.
2c9580b
+
2c9580b
+This Fedora-patched package returns "/etc/pki/tls/certs/ca-bundle.crt" provided
2c9580b
+by the ca-certificates RPM package.
2c9580b
 """
2c9580b
-from certifi import where
2c9580b
+try:
2c9580b
+    from certifi import where
2c9580b
+except ImportError:
2c9580b
+    def where():
2c9580b
+        """Return the absolute path to the system CA bundle."""
2c9580b
+        return '/etc/pki/tls/certs/ca-bundle.crt'
2c9580b
+
2c9580b
 
2c9580b
 if __name__ == '__main__':
2c9580b
     print(where())
42ab4cc
diff --git a/setup.py b/setup.py
42ab4cc
index 93a8507..2db9569 100755
42ab4cc
--- a/setup.py
42ab4cc
+++ b/setup.py
42ab4cc
@@ -45,7 +45,6 @@ requires = [
42ab4cc
     'chardet>=3.0.2,<3.1.0',
c281f15
     'idna>=2.5,<2.7',
33a34fd
     'urllib3>=1.21.1,<1.23',
42ab4cc
-    'certifi>=2017.4.17'
42ab4cc
 
42ab4cc
 ]
42ab4cc
 test_requirements = ['pytest-httpbin==0.0.7', 'pytest-cov', 'pytest-mock', 'pytest-xdist', 'PySocks>=1.5.6, !=1.5.7', 'pytest>=2.8.0']
2c9580b
-- 
2c9580b
2.9.4
2c9580b