How to make Python use CA certificates from Mac OS TrustStore?

前端 未结 6 1736
遥遥无期
遥遥无期 2020-11-30 04:05

I need to use curtom root certificates on the company intranet and loading them in the Mac OS TrustStore (KeyChain) does solve the problem for all browsers and GUI apps.

6条回答
  •  旧巷少年郎
    2020-11-30 04:21

    This is also a problem in Python 3.6 with MacOS Sierrra. I know your use case is different. But I stumbled upon this thread while investigating this problem. So if anyone is also having this article is worth checking out:

    http://www.cdotson.com/2017/01/sslerror-with-python-3-6-x-on-macos-sierra/

    In a nutshell: Python 3.6 does not rely on MacOS' openSSL anymore. It comes with its own openSSL bundled and doesn't have access on MacOS' root certificates.

    You have two options:

    Run an install command shipped with Python 3.6

    cd /Applications/Python\ 3.6/
    ./Install\ Certificates.command
    

    or

    Install the certifi package with

    pip install certifi
    

    I chose the first option and it worked.

提交回复
热议问题