Created
May 7, 2018 19:51
-
-
Save dillonhafer/3a63ed1e38292500ef354ed0c64f82f8 to your computer and use it in GitHub Desktop.
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
fqdn="test.dillonhafer.com" | |
# Ubuntu | |
# config_file="/usr/lib/ssl/openssl.cnf" | |
# macOS | |
# config_file="/System/Library/OpenSSL/openssl.cnf" | |
openssl req \ | |
-newkey rsa:2048 \ | |
-x509 \ | |
-nodes \ | |
-keyout $fqdn.key \ | |
-new \ | |
-out $fqdn.crt \ | |
-subj /CN=$fqdn \ | |
-reqexts SAN \ | |
-extensions SAN \ | |
-config <(cat $config_file \ | |
<(printf '[SAN]\nsubjectAltName=DNS:%s' $fqdn)) \ | |
-sha256 \ | |
-days 3650 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment