summaryrefslogtreecommitdiff
path: root/src/leap/common/ca_bundle.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-10-29 12:00:39 -0400
committerKali Kaneko <kali@leap.se>2015-10-29 12:00:39 -0400
commitee0e9cadccd00cb62032d8fc4b322bb6fe3dc7ed (patch)
treeaae58b3f251c5a621d75b8d77428bbd90699e560 /src/leap/common/ca_bundle.py
parent3ab6b2aff4a38a4fabd4320880ef795f05ccd17f (diff)
parent3fabc788c27b2c2619d8e23b3eebc018b95faf7a (diff)
Merge tag '0.4.4' into debian/experimental
Tag leap.common version 0.4.4
Diffstat (limited to 'src/leap/common/ca_bundle.py')
-rw-r--r--src/leap/common/ca_bundle.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/leap/common/ca_bundle.py b/src/leap/common/ca_bundle.py
index 2c41d18..e2a624d 100644
--- a/src/leap/common/ca_bundle.py
+++ b/src/leap/common/ca_bundle.py
@@ -21,8 +21,9 @@ 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.
"""
-import platform
import os.path
+import platform
+import sys
_system = platform.system()
@@ -34,11 +35,10 @@ def where():
Return the preferred certificate bundle.
: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")
+ if getattr(sys, 'frozen', False):
+ # we are running in a |PyInstaller| bundle
+ path = sys._MEIPASS
+ return os.path.join(path, 'cacert.pem')
return os.path.join(os.path.dirname(__file__), 'cacert.pem')
if __name__ == '__main__':