Update csr.sh

This commit is contained in:
2018-01-06 22:04:09 -05:00
parent cb8c1784ab
commit b36fc5225b

13
csr.sh
View File

@@ -1,7 +1,10 @@
#!/bin/bash
URL=$1
HOSTNAME=$1
DOMAIN="home.johnhagunt.com"
openssl req -new -sha512 -nodes -out $URL.ad.johnhgaunt.com.csr -newkey rsa:4096 -keyout $URL.ad.johnhgaunt.com.key -config <(
#read -p 'Hostname: ' hostname
openssl req -new -sha512 -nodes -out $HOSTNAME.$DOMAIN.csr -newkey rsa:4096 -keyout $HOSTNAME.$DOMAIN.key -config <(
cat <<-EOF
[req]
default_bits = 4096
@@ -17,13 +20,13 @@ L=Pittsburgh
O=Gaunt
OU=Gaunt
emailAddress=admin@johnhgaunt.com
CN=$URL.ad.johnhgaunt.com
CN=$HOSTNAME.$DOMAIN
[ req_ext ]
subjectAltName = @alt_names
[ alt_names ]
DNS.1 = $URL.ad.johnhgaunt.com
DNS.2 = $URL
DNS.1 = $HOSTNAME.$DOMAIN
DNS.2 = $HOSTNAME
EOF
)