Files
bancho.py/tools/local_cert_generator.sh
2025-04-04 21:32:15 +09:00

14 lines
516 B
Bash

#!/usr/bin/env bash
read -p "What's the name of your server? " name
name=${name=Bancho}
read -p "What's the base domain of your server? " domain
domain=*.${domain=ppy.sh}
read -p "What country is this based in? (ISO country code) " location
location=${location=CA}
args="/CN=$domain/O=$name/C=$location"
openssl req -subj $args -new -newkey rsa:4096 -sha256 -days 36500 -nodes -x509 -keyout key.pem -out cert.pem
openssl x509 -outform der -in cert.pem -out cert.crt
printf "Your certificates have been generated."