From c1781d87a76f941c588709405cd5b2634dc6b1e8 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 9 Oct 2015 15:01:13 -0400 Subject: [bug] fix wrong ca_cert path inside bundle -Resolves: #7524 --- src/leap/common/ca_bundle.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/leap/common/ca_bundle.py b/src/leap/common/ca_bundle.py index 2c41d18..c0ce35f 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,12 +35,11 @@ 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") - return os.path.join(os.path.dirname(__file__), '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__': print(where()) -- cgit v1.2.3