Skip to content

Instantly share code, notes, and snippets.

@dlundgren
Created September 3, 2020 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlundgren/ea59b35b7d1c04c38612164b0e7151f5 to your computer and use it in GitHub Desktop.
Save dlundgren/ea59b35b7d1c04c38612164b0e7151f5 to your computer and use it in GitHub Desktop.
Make Mac OS keychain certs available to Brewed python3
#!/bin/sh
CERT_PATH=$(python3 -m certifi)
security find-certificate -a -p /Library/Keychains/System.keychain > ${CERT_PATH}
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> ${CERT_PATH}
@dlundgren
Copy link
Author

You need to have certifi installed for python3 pip3 install certifi

You also need the following in your bashrc or wherever you want to put it

CERT_PATH=$(python3 -m certifi)
export SSL_CERT_FILE=${CERT_PATH}
export REQUESTS_CA_BUNDLE=${CERT_PATH}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment