Look for cacert.pem in the Resources dir in OSX
authorTomás Touceda <chiiph@leap.se>
Thu, 10 Jul 2014 14:29:31 +0000 (11:29 -0300)
committerTomás Touceda <chiiph@leap.se>
Thu, 10 Jul 2014 14:39:26 +0000 (11:39 -0300)
changes/feature_support_cacert_osx [new file with mode: 0644]
src/leap/common/ca_bundle.py

diff --git a/changes/feature_support_cacert_osx b/changes/feature_support_cacert_osx
new file mode 100644 (file)
index 0000000..90a51bf
--- /dev/null
@@ -0,0 +1 @@
+  o Look for bundled cacert.pem in the Resources dir for OSX.
\ No newline at end of file
index 1e00f25..d8c72a6 100644 (file)
@@ -21,8 +21,12 @@ 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.
 """
 environment, you can change the definition of where() to return a separately
 packaged CA bundle.
 """
+import platform
 import os.path
 
 import os.path
 
+_system = platform.system()
+
+IS_MAC = _system == "Darwin"
 
 def where():
     """
 
 def where():
     """
@@ -30,6 +34,10 @@ def where():
     :rtype: str
     """
     # vendored bundle inside Requests, plus some additions of ours
     :rtype: str
     """
     # vendored bundle inside Requests, plus some additions of ours
+    if IS_MAC:
+        return os.path.join("/Applications", "Bitmask.app",
+                            "Contents", "Resources",
+                            "cacert.pem")
     return os.path.join(os.path.dirname(__file__), 'cacert.pem')
 
 if __name__ == '__main__':
     return os.path.join(os.path.dirname(__file__), 'cacert.pem')
 
 if __name__ == '__main__':