Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Last active October 14, 2020 10:50
Show Gist options
  • Select an option

  • Save ziadoz/bf09b903ad4e2c99b590c71ef195b93b to your computer and use it in GitHub Desktop.

Select an option

Save ziadoz/bf09b903ad4e2c99b590c71ef195b93b to your computer and use it in GitHub Desktop.
Add and Remove Laravel Homestead Root CA to and from the macOS Keychain
sudo security delete-certificate -c "Homestead homestead Root CA" /Library/Keychains/System.keychain 2> /dev/null
sudo security add-trusted-cert -d -r trustRoot -p ssl -k /Library/Keychains/System.keychain ~/Projects/homestead/ca.homestead.homestead.crt 2> /dev/null
function homestead() {
( cd ~/Projects/homestead && vagrant $* )
if [[ "$1" == "destroy" ]]; then
sudo security delete-certificate -c "Homestead homestead Root CA" /Library/Keychains/System.keychain 2> /dev/null
fi
if [[ "$1" == "up" ]]; then
sudo security add-trusted-cert -d -r trustRoot -p ssl -k /Library/Keychains/System.keychain ~/Projects/homestead/ca.homestead.homestead.crt 2> /dev/null
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment