Skip to content

Instantly share code, notes, and snippets.

@eodgooch
Created May 26, 2017 21:00
Show Gist options
  • Save eodgooch/257e78631ea4fa0f1ca9a2cb661bd669 to your computer and use it in GitHub Desktop.
Save eodgooch/257e78631ea4fa0f1ca9a2cb661bd669 to your computer and use it in GitHub Desktop.
Make a CSR with openssl
openssl genrsa -des3 -out server.key 2048
openssl rsa -in server.key -out server.key
openssl req -sha256 -new -key server.key -out server.csr -subj '/CN=localhost'
# next line signs the cert - not necessary if a CA is signing simply grab the csr file from above
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
#Replace 'localhost' with whatever domain you require. You will need to run the first two commands one by one as openssl will prompt for a passphrase.
#To combine the two into a .pem file:
cat server.crt server.key > cert.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment