Skip to content

Instantly share code, notes, and snippets.

@deekayen
Created March 13, 2018 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deekayen/e60a7e06d478965c49c02c083aa632a8 to your computer and use it in GitHub Desktop.
Save deekayen/e60a7e06d478965c49c02c083aa632a8 to your computer and use it in GitHub Desktop.
Generate a multi subdomain-wildcard CSR.
cat > csr_details.txt <<-EOF
[req]
default_bits = 3072
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
C=US
ST=Georgia
L=Somewhere
O=Online
CN = *.deekayen.net
[ req_ext ]
subjectAltName = @alt_names
[ alt_names ]
DNS.1 = *.deekayen.net
DNS.2 = deekayen.net
DNS.3 = *.*.deekayen.net
EOF
# Let’s call openssl now by piping the newly created file in
openssl req -new -sha256 -nodes -out \*.deekayen.net.csr -newkey rsa:3072 -keyout \*.deekayen.net.key -config <( cat csr_details.txt )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment