Created
September 20, 2017 06:47
-
-
Save cxhercules/26d79895e18dbc8ad699dc60b751012d to your computer and use it in GitHub Desktop.
Create a Wildcard SubjectAltName Self-Signed Certificate
This file contains 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
#!/usr/bin/env bash | |
# See: http://apetec.com/support/GenerateSAN-CSR.htm | |
# See: http://fbcs.co.uk/self-signed-multiple-domain-ssl-certificates/ | |
# See: https://gist.github.com/scottvrosenthal/5691305 | |
# Make a temp directory and go there | |
TMP_DIR=$(mktemp -d) | |
cd $TMP_DIR | |
echo $(pwd) | |
# Create an OpenSSL configuration file | |
cp /etc/ssl/openssl.cnf openssl.cnf | |
# EDIT The file | |
# See: http://fbcs.co.uk/self-signed-multiple-domain-ssl-certificates/ | |
# Generate the private key | |
openssl genrsa 4096 > private.key | |
# Generate the certificate | |
openssl req -new -x509 -nodes -sha256 -days 3650 -key private.key -out wild-san.crt -config openssl.cnf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment