Created
April 8, 2011 16:05
-
-
Save danreedy/910179 to your computer and use it in GitHub Desktop.
Scripting the automation of an interactive script to generate a self-signed certificate for POW usage
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
# Generate our local key | |
openssl genrsa 2048 > local.key | |
# Create the self-signed certificate for all *.dev addresses | |
openssl req -new -x509 -nodes -sha1 -days 3650 -key local.key << ANSWERS > local.cert | |
US | |
IL | |
Chicago | |
Myself | |
Me | |
*.dev | |
admin@localhost | |
ANSWERS | |
# Create the fingerprint file | |
openssl x509 -noout -fingerprint -text < local.cert > local.info | |
# Combine our key and self-signed cert into a certificate | |
cat local.cert local.key > local.pem | |
# Add the certificate to our trusted root | |
sudo /usr/bin/security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" "local.pem" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment