Skip to content

Instantly share code, notes, and snippets.

@nicopace
Created February 13, 2018 13:55
Show Gist options
  • Save nicopace/0350ddf8880231bbdb1cd07963af9052 to your computer and use it in GitHub Desktop.
Save nicopace/0350ddf8880231bbdb1cd07963af9052 to your computer and use it in GitHub Desktop.
Generate mock root certificate without console interaction
#!/bin/bash
PRIVATE_KEY_PASS=1234
openssl genrsa -des3 -out myCA.key -passout pass:$PRIVATE_KEY_PASS 2048
openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem -passin pass:$PRIVATE_KEY_PASS -multivalue-rdn -subj /CN=My\ Name/OU=My\ Organization/emailAddress=someone@somewhere.org
echo 'A pass generated in myCA.key and a root cert in myCA.pem'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment