Created
March 5, 2021 19:18
-
-
Save tjklemz/f7236d82af1da1d5899f6c3da930a73b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Certs https://stackoverflow.com/a/55249339/958007 | |
function setup-certs() { | |
local cert_path="$HOME/.certs/all.pem" | |
local cert_dir=$(dirname "${cert_path}") | |
[[ -d "${cert_dir}" ]] || mkdir -p "${cert_dir}" | |
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain > "${cert_path}" | |
security find-certificate -a -p /Library/Keychains/System.keychain >> "${cert_path}" | |
export GIT_SSL_CAINFO="${cert_path}" | |
export AWS_CA_BUNDLE="${cert_path}" | |
export NODE_EXTRA_CA_CERTS="${cert_path}" | |
npm config set -g cafile "${cert_path}" | |
npm config set -g strict-ssl true | |
yarn config set cafile "${cert_path}" -g | |
yarn config set strict-ssl true -g | |
} | |
function unset-certs() { | |
[[ ! -f "$HOME/.certs/all.pem" ]] || rm "$HOME/.certs/all.pem"; | |
} | |
setup-certs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment