
This allows the library to interact gracefully with additional certificates users might have configured in /etc/ssl/certs/ca-certificates.crt via NixOS.
44 lines
1.3 KiB
Diff
44 lines
1.3 KiB
Diff
From f04105df552309880ede3176c48930762843ea8d Mon Sep 17 00:00:00 2001
|
|
From: Peter Simons <simons@cryp.to>
|
|
Date: Thu, 9 Feb 2017 15:06:36 +0100
|
|
Subject: [PATCH] requests/certs.py: use system-wide cert bundle from NixOS
|
|
rather than our own
|
|
|
|
---
|
|
requests/certs.py | 17 ++++-------------
|
|
1 file changed, 4 insertions(+), 13 deletions(-)
|
|
|
|
diff --git a/requests/certs.py b/requests/certs.py
|
|
index f922b99d..0209ecc2 100644
|
|
--- a/requests/certs.py
|
|
+++ b/requests/certs.py
|
|
@@ -5,21 +5,12 @@
|
|
requests.certs
|
|
~~~~~~~~~~~~~~
|
|
|
|
-This module returns the preferred default CA certificate bundle.
|
|
-
|
|
-If you are packaging Requests, e.g., for a Linux distribution or a managed
|
|
-environment, you can change the definition of where() to return a separately
|
|
-packaged CA bundle.
|
|
+This module returns the preferred default CA certificate bundle (for NixOS).
|
|
"""
|
|
-import os.path
|
|
|
|
-try:
|
|
- from certifi import where
|
|
-except ImportError:
|
|
- def where():
|
|
- """Return the preferred certificate bundle."""
|
|
- # vendored bundle inside Requests
|
|
- return os.path.join(os.path.dirname(__file__), 'cacert.pem')
|
|
+def where():
|
|
+ """Return the preferred certificate bundle."""
|
|
+ return "/etc/ssl/certs/ca-certificates.crt"
|
|
|
|
if __name__ == '__main__':
|
|
print(where())
|
|
--
|
|
2.11.1
|
|
|