Generating self-signed SSL certificates for use with nginxEdit

Here is how I generated a worthless "throwaway" self-signed SSL certificate for use with nginx in my staging environment.

# generate super secret private key
# (not really, this key and the certificate are "throwaway" items)
openssl genrsa -des3 -out ssl.key 1024

# generate the self-signed certificate
openssl req -new -x509 -nodes -sha1 -days 365 -key ssl.key -out ssl.crt

# create decrypted version of key so that nginx can be started without a passphrase
openssl rsa -in ssl.key -out ssl.key.insecure
chmod 600 ssl.key.insecure

See also