diff options
author | Peter Simons <simons@cryp.to> | 2017-02-09 15:11:34 +0100 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2017-02-09 15:19:36 +0100 |
commit | 768c970c8d339f76947976c31ad2c8723247a8f3 (patch) | |
tree | 3f7caccef8f513b186d8d0120f0613dc4fdbfd25 /pkgs/development/python-modules/requests | |
parent | f800a4b1976e90f41e67eb3e7a89c25890ea7b11 (diff) | |
download | nixlib-768c970c8d339f76947976c31ad2c8723247a8f3.tar nixlib-768c970c8d339f76947976c31ad2c8723247a8f3.tar.gz nixlib-768c970c8d339f76947976c31ad2c8723247a8f3.tar.bz2 nixlib-768c970c8d339f76947976c31ad2c8723247a8f3.tar.lz nixlib-768c970c8d339f76947976c31ad2c8723247a8f3.tar.xz nixlib-768c970c8d339f76947976c31ad2c8723247a8f3.tar.zst nixlib-768c970c8d339f76947976c31ad2c8723247a8f3.zip |
python-requests2: use system-wide CA bundle rather than our own
This allows the library to interact gracefully with additional certificates users might have configured in /etc/ssl/certs/ca-certificates.crt via NixOS.
Diffstat (limited to 'pkgs/development/python-modules/requests')
-rw-r--r-- | pkgs/development/python-modules/requests/0001-requests-certs.py-use-system-wide-cert-bundle-from-N.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/requests/0001-requests-certs.py-use-system-wide-cert-bundle-from-N.patch b/pkgs/development/python-modules/requests/0001-requests-certs.py-use-system-wide-cert-bundle-from-N.patch new file mode 100644 index 000000000000..e27a77839552 --- /dev/null +++ b/pkgs/development/python-modules/requests/0001-requests-certs.py-use-system-wide-cert-bundle-from-N.patch @@ -0,0 +1,43 @@ +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 + |