Skip to content

Instantly share code, notes, and snippets.

@macintoshhelper
Created May 7, 2017 10:06
Show Gist options
  • Save macintoshhelper/ad901defc48f8e125408c1312626be7d to your computer and use it in GitHub Desktop.
Save macintoshhelper/ad901defc48f8e125408c1312626be7d to your computer and use it in GitHub Desktop.
Initialise fake SSL certificate for localhost
openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out csr.pem -subj "/C=US/ST=None/L=None/O=None/CN=localhost"
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem
mkdir keys
mv cert.pem keys/cert.pem
mv key.pem keys/key.pem
echo 'keys/' >> .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment