Created
February 3, 2016 21:54
-
-
Save JCotton1123/a1db85b8ce9dd1e98ad1 to your computer and use it in GitHub Desktop.
Generate an SSL certificate and key with multiple subject alternative names
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
#!/bin/sh | |
subject='/C=US/ST=California/L=San Francisco/O=Organization/OU=Operations/CN=*.orgdev.net/emailAddress=operations@org.co' | |
subject="${subject}/subjectAltName=DNS.1=orgdev.net,DNS.2=*.orgdev.net,DNS.3=dev.orgdev.net,DNS.4=*.dev.orgdev.net" | |
openssl genrsa -out server.key 2048 | |
openssl req -new -key server.key -sha256 -nodes -subj "$subject" > server.csr | |
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment