Skip to content

Instantly share code, notes, and snippets.

@4lun
Created February 14, 2017 08:43
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 4lun/da5e8602a55c3ab257202923c812dae6 to your computer and use it in GitHub Desktop.
Save 4lun/da5e8602a55c3ab257202923c812dae6 to your computer and use it in GitHub Desktop.
Generate a self signed wildcard SSL cert (run one line at a time)
# Based on: http://blog.celogeek.com/201209/209/how-to-create-a-self-signed-wildcard-certificate/
# Replace .domain.com with desired domain (and x.domain instances)
openssl genrsa 2048 > x.domain.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key x.domain.key > x.domain.cert
# Interactive prompt: enter *.domain.com for the Common Name
openssl x509 -noout -fingerprint -text < x.domain.cert > x.domain.info
cat x.domain.cert x.domain.key > x.domain.pem
chmod 400 x.domain.key x.domain.pem
# Optional, get public key
# e.g. useful for backend instance verification on AWS ELB
openssl rsa -in x.domain.pem -pubout > x.domain.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment