Skip to content

Instantly share code, notes, and snippets.

@jayphelps
Created May 1, 2020 06:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jayphelps/42f4f00b695b778a4f4ef629a391804c to your computer and use it in GitHub Desktop.
Save jayphelps/42f4f00b695b778a4f4ef629a391804c to your computer and use it in GitHub Desktop.
Add .crt SSL certificate to macOS Keychain via command line
SCRIPT="security add-trusted-cert -d -r trustAsRoot -p ssl -p basic -k /Library/Keychains/System.keychain "filename.crt""
osascript -e "do shell script \"$SCRIPT\" with administrator privileges"
# or you can just run the above SCRIPT command with sudo directly.
# This osascript stuff is so that you get a native OS password prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment