Skip to content

Instantly share code, notes, and snippets.

@janeczku
Last active March 18, 2024 12:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janeczku/3d4de6b70fca83447de4a72bad1f7317 to your computer and use it in GitHub Desktop.
Save janeczku/3d4de6b70fca83447de4a72bad1f7317 to your computer and use it in GitHub Desktop.
How to trust custom, self-signed certificates by adding the CA cert to the macOS keychain

Method 1: Add the CA cert to the system certificate store

$ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.crt

Method 2: Add the CA cert to the user's local keychain only

$ sudo security add-trusted-cert -d -r trustRoot -k ~/Library/Keychains/login.keychain ca.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment