Skip to content

Instantly share code, notes, and snippets.

@devopsmariocom
Created February 16, 2016 12:29
Show Gist options
  • Save devopsmariocom/ffdd2b82a56e8d63d7df to your computer and use it in GitHub Desktop.
Save devopsmariocom/ffdd2b82a56e8d63d7df to your computer and use it in GitHub Desktop.
Simple script to install root cert from self signed server
#!/bin/bash
# Usage: $ install-root-cert.sh serve.name.local 8443
openssl s_client -showcerts -connect $1:$2 </dev/null 2>/dev/null|openssl x509 -outform PEM > ./$1.pem
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ./$1.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment