Skip to content

Instantly share code, notes, and snippets.

@rmtsrc
Created November 1, 2016 14:05
Show Gist options
  • Save rmtsrc/b2d936cf6ae94950d4579cb11452848c to your computer and use it in GitHub Desktop.
Save rmtsrc/b2d936cf6ae94950d4579cb11452848c to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
FQDN[0]="test.example.com"
FQDN[1]="test2.example.com"
for hn in "${FQDN[@]}"
do
echo $hn
mkdir $hn.ssl
openssl genrsa -out $hn.ssl/$hn.key 2048
openssl req -new -sha256 -subj "/C=GB/ST=Greater London/L=London/O=My Organisation/OU=My Department/CN=$hn" -key $hn.ssl/$hn.key -out $hn.ssl/$hn.csr
done
find . -iname \*.csr -print | zip signing-requests.zip -@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment