[Python-modules-commits] [python-pyld] 129/276: Check a list of potential certificate paths.

Wolfgang Borgert debacle at moszumanska.debian.org
Wed Oct 8 23:48:01 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-pyld.

commit eca003a164107eca9b5a3996674335842b08318a
Author: David I. Lehn <dlehn at digitalbazaar.com>
Date:   Fri Jun 14 16:20:30 2013 -0400

    Check a list of potential certificate paths.
    
    - Add possible MacOS X certificate paths.
---
 lib/pyld/jsonld.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py
index 18e9222..837285c 100644
--- a/lib/pyld/jsonld.py
+++ b/lib/pyld/jsonld.py
@@ -4265,8 +4265,17 @@ class VerifiedHTTPSHandler(urllib2.HTTPSHandler):
 
 # the path to the system's default trusted root SSL certificates
 _trust_root_certificates = None
-if os.path.exists('/etc/ssl/certs/ca-certificates.crt'):
-    _trust_root_certificates = '/etc/ssl/certs/ca-certificates.crt'
+_possible_trust_root_certificates = [
+    '/etc/ssl/certs/ca-certificates.crt',
+    '~/Library/OpenSSL/certs/ca-certificates.crt',
+    '/System/Library/OpenSSL/certs/ca-certificates.crt',
+]
+for path in _possible_trust_root_certificates:
+    path = os.path.expanduser(path)
+    if os.path.exists(path):
+        _trust_root_certificates = path
+        break
+# FIXME: warn if not found?  MacOS X uses keychain vs file.
 
 
 # Shared in-memory caches.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pyld.git



More information about the Python-modules-commits mailing list