|
|
f019b5 |
From a8ef690988f92a56226f8b688f1a3638346bca8e Mon Sep 17 00:00:00 2001
|
|
|
f019b5 |
From: Jeremy Cline <jeremy@jcline.org>
|
|
|
f019b5 |
Date: Mon, 19 Jun 2017 16:09:02 -0400
|
|
|
f019b5 |
Subject: [PATCH] Patch requests/certs.py to use the system CA bundle
|
|
|
f019b5 |
|
|
|
f019b5 |
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
|
|
|
f019b5 |
---
|
|
|
f019b5 |
requests/certs.py | 11 ++++++++++-
|
|
|
f019b5 |
setup.py | 1 -
|
|
|
f019b5 |
2 files changed, 10 insertions(+), 2 deletions(-)
|
|
|
f019b5 |
|
|
|
f019b5 |
diff --git a/requests/certs.py b/requests/certs.py
|
|
|
f019b5 |
index d1a378d7..7b103baf 100644
|
|
|
f019b5 |
--- a/requests/certs.py
|
|
|
f019b5 |
+++ b/requests/certs.py
|
|
|
f019b5 |
@@ -11,8 +11,17 @@ only one — the one from the certifi package.
|
|
|
f019b5 |
If you are packaging Requests, e.g., for a Linux distribution or a managed
|
|
|
f019b5 |
environment, you can change the definition of where() to return a separately
|
|
|
f019b5 |
packaged CA bundle.
|
|
|
f019b5 |
+
|
|
|
f019b5 |
+This Fedora-patched package returns "/etc/pki/tls/certs/ca-bundle.crt" provided
|
|
|
f019b5 |
+by the ca-certificates RPM package.
|
|
|
f019b5 |
"""
|
|
|
f019b5 |
-from certifi import where
|
|
|
f019b5 |
+try:
|
|
|
f019b5 |
+ from certifi import where
|
|
|
f019b5 |
+except ImportError:
|
|
|
f019b5 |
+ def where():
|
|
|
f019b5 |
+ """Return the absolute path to the system CA bundle."""
|
|
|
f019b5 |
+ return '/etc/pki/tls/certs/ca-bundle.crt'
|
|
|
f019b5 |
+
|
|
|
f019b5 |
|
|
|
f019b5 |
if __name__ == '__main__':
|
|
|
f019b5 |
print(where())
|
|
|
f019b5 |
diff --git a/setup.py b/setup.py
|
|
|
f019b5 |
index 4e2ad936..60de5861 100755
|
|
|
f019b5 |
--- a/setup.py
|
|
|
f019b5 |
+++ b/setup.py
|
|
|
f019b5 |
@@ -45,7 +45,6 @@ requires = [
|
|
|
f019b5 |
'chardet>=3.0.2,<3.1.0',
|
|
|
f019b5 |
'idna>=2.5,<2.8',
|
|
|
f019b5 |
'urllib3>=1.21.1,<1.25',
|
|
|
f019b5 |
- 'certifi>=2017.4.17'
|
|
|
f019b5 |
|
|
|
f019b5 |
]
|
|
|
f019b5 |
test_requirements = [
|
|
|
f019b5 |
--
|
|
|
f019b5 |
2.19.1
|
|
|
f019b5 |
|