diff options
Diffstat (limited to 'src/leap/common/ca_bundle.py')
-rw-r--r-- | src/leap/common/ca_bundle.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/leap/common/ca_bundle.py b/src/leap/common/ca_bundle.py index d8c72a6..e2a624d 100644 --- a/src/leap/common/ca_bundle.py +++ b/src/leap/common/ca_bundle.py @@ -21,23 +21,24 @@ 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() IS_MAC = _system == "Darwin" + 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__': |