Skip to content

Instantly share code, notes, and snippets.

@lorenzo95
Forked from JakeDEvans/generate-csr.sh
Created August 19, 2020 14:41
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 lorenzo95/440671634c707f96f85d0c7e3e0ae137 to your computer and use it in GitHub Desktop.
Save lorenzo95/440671634c707f96f85d0c7e3e0ae137 to your computer and use it in GitHub Desktop.
one-liner CSR generation for Multi SAN Certificates openssl
openssl req -new -newkey rsa:2048 -nodes -sha256 -keyout example.key -subj "/C=US/ST=CA/O=Organization/OU=Department/CN=example" -config <(
cat <<-EOF
[req]
default_bits = 2048
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
[ req_ext ]
subjectAltName = @alt_names
[alt_names]
DNS.1 = example.com
DNS.2 = www.example.com
EOF
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment