Skip to content

Instantly share code, notes, and snippets.

@gil-obradors
Created March 21, 2015 10:19
Show Gist options
  • Save gil-obradors/4ea26cb8e3ae010df8ab to your computer and use it in GitHub Desktop.
Save gil-obradors/4ea26cb8e3ae010df8ab to your computer and use it in GitHub Desktop.
SSL cheats
# Create CA
openssl genrsa -out ca.key 4096
openssl req -new -x509 -nodes -sha1 -days 1825 -key ca.key -out ca.crt
# Create Intermediate
openssl genrsa -out intermediate.key 4096
openssl req -new -sha1 -key intermediate.key -out intermediate.csr
# CA signs Intermediate
openssl x509 -req -days 1825 -in intermediate.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out intermediate.crt
# Create Server
openssl genrsa -out test.example.com.key 4096
openssl req -new -key test.example.com.key -out test.example.com.csr
# Intermediate signs Server
openssl x509 -req -days 1825 -in test.example.com.csr -CA intermediate.crt -CAkey intermediate.key -set_serial 01 -out test.example.com.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment