Skip to content

Instantly share code, notes, and snippets.

@drscream
Created July 25, 2014 15:15
Show Gist options
  • Save drscream/df9974418fbcac410f98 to your computer and use it in GitHub Desktop.
Save drscream/df9974418fbcac410f98 to your computer and use it in GitHub Desktop.
# root ca
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -days 365 -out rootCA.crt -subj "/C=DE/L=Raindbow City/O=Aperture Science/OU=Please use valid ssl certificate/CN=ROOT CA MASTER GOD"
# host cert
host=my-hostname
openssl genrsa -out host.key 2048
openssl req -new -key host.key -out host.csr -subj "/C=DE/L=Raindbow City/O=Aperture Science/OU=Please use valid ssl certificate/CN=${host}"
# sign my host cert with ca
openssl x509 -req -in host.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out host.crt -days 365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment