Add script for generating TLS certs

This commit is contained in:
raul 2024-07-03 10:05:20 +02:00
parent 824f52c80e
commit 149c0bcecc
1 changed files with 10 additions and 0 deletions

10
cmd/gen-cert.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
SSLCOMMAND=$(which openssl)
if [[ ! -d "~/.config/tiamat" ]]; then
mkdir ~/.config/tiamat
fi
$SSLCOMMAND genrsa -out ~/.config/tiamat/server.key 2048
$SSLCOMMAND req -new -x509 -sha256 -key ~/.config/tiamat/server.key -out ~/.config/tiamat/server.crt -days 3650 -subj "/C=ES/ST=Valencia/L=Valencia/O=mini-chat /OU=tiamat/CN=tiamat"