Created
September 26, 2013 19:43
-
-
Save gionn/6719501 to your computer and use it in GitHub Desktop.
Simple script to generate a self-signed certificate for a domain (use *.domain.tld for a wildcard certificate) to be used on webserver (apache2, nginx).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
openssl genrsa 2048 > host.key | |
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert | |
openssl x509 -noout -fingerprint -text < host.cert > host.info | |
cat host.cert host.key > host.pem | |
chmod 400 host.key host.pem | |
echo ## put on your nginx virtualhost ## | |
echo ssl on; | |
echo ssl_certificate /path/to/host.pem; | |
echo ssl_certificate_key /path/to/host.key; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment