mercurial/sslutil.py
changeset 30641 16b5df5792a8
parent 30639 d524c88511a7
child 30669 10b17ed9b591
equal deleted inserted replaced
30640:7a3e67bfa417 30641:16b5df5792a8
   666       system
   666       system
   667     * presumably is an Apple Python that uses Apple OpenSSL which has patches
   667     * presumably is an Apple Python that uses Apple OpenSSL which has patches
   668       for using system certificate store CAs in addition to the provided
   668       for using system certificate store CAs in addition to the provided
   669       cacerts file
   669       cacerts file
   670     """
   670     """
   671     if sys.platform != 'darwin' or util.mainfrozen() or not sys.executable:
   671     if (pycompat.sysplatform != 'darwin' or
       
   672                         util.mainfrozen() or not sys.executable):
   672         return False
   673         return False
   673     exe = os.path.realpath(sys.executable).lower()
   674     exe = os.path.realpath(sys.executable).lower()
   674     return (exe.startswith('/usr/bin/python') or
   675     return (exe.startswith('/usr/bin/python') or
   675             exe.startswith('/system/library/frameworks/python.framework/'))
   676             exe.startswith('/system/library/frameworks/python.framework/'))
   676 
   677 
   723         if os.path.exists(dummycert):
   724         if os.path.exists(dummycert):
   724             return dummycert
   725             return dummycert
   725 
   726 
   726     # The Apple OpenSSL trick isn't available to us. If Python isn't able to
   727     # The Apple OpenSSL trick isn't available to us. If Python isn't able to
   727     # load system certs, we're out of luck.
   728     # load system certs, we're out of luck.
   728     if sys.platform == 'darwin':
   729     if pycompat.sysplatform == 'darwin':
   729         # FUTURE Consider looking for Homebrew or MacPorts installed certs
   730         # FUTURE Consider looking for Homebrew or MacPorts installed certs
   730         # files. Also consider exporting the keychain certs to a file during
   731         # files. Also consider exporting the keychain certs to a file during
   731         # Mercurial install.
   732         # Mercurial install.
   732         if not _canloaddefaultcerts:
   733         if not _canloaddefaultcerts:
   733             ui.warn(_('(unable to load CA certificates; see '
   734             ui.warn(_('(unable to load CA certificates; see '