From 149c0bceccf7f7c26c800a57d8570656cc2e491c Mon Sep 17 00:00:00 2001 From: raul Date: Wed, 3 Jul 2024 10:05:20 +0200 Subject: [PATCH] Add script for generating TLS certs --- cmd/gen-cert.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 cmd/gen-cert.sh diff --git a/cmd/gen-cert.sh b/cmd/gen-cert.sh new file mode 100755 index 0000000..cce9c26 --- /dev/null +++ b/cmd/gen-cert.sh @@ -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"