This repository has been archived on 2025-03-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
rclone-upload/csr.sh
2018-01-06 22:04:09 -05:00

32 lines
533 B
Bash

#!/bin/bash
HOSTNAME=$1
DOMAIN="home.johnhagunt.com"
#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
prompt = no
default_md = sha512
req_extensions = req_ext
distinguished_name = dn
[ dn ]
C=US
ST=PA
L=Pittsburgh
O=Gaunt
OU=Gaunt
emailAddress=admin@johnhgaunt.com
CN=$HOSTNAME.$DOMAIN
[ req_ext ]
subjectAltName = @alt_names
[ alt_names ]
DNS.1 = $HOSTNAME.$DOMAIN
DNS.2 = $HOSTNAME
EOF
)