Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

dlundgren commented Sep 3, 2020

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