Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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