Skip to content

Instantly share code, notes, and snippets.

@aklinkert
Last active September 24, 2015 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aklinkert/82b3d23b9a79ab25bece to your computer and use it in GitHub Desktop.
Save aklinkert/82b3d23b9a79ab25bece to your computer and use it in GitHub Desktop.
Create self signed ssl certifgicate
#!/bin/bash
timestamp() {
date +"%s"
}
name=$(timestamp)
echo "creating key files in dir ./tmp-$name/"
mkdir ./tmp-$name && cd $_
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
cp server.crt server.key ../
cd ..
rm -r ./tmp-$name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment