This commit is contained in:
CanbiZ (MickLesk) 2026-01-29 12:26:20 +01:00
parent b4af893e66
commit a2bbf6c75f

View File

@ -40,8 +40,15 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
read -r -p "${TAB3}Use TLS-only mode (disable TCP port 6379)? [y/N]: " tls_only read -r -p "${TAB3}Use TLS-only mode (disable TCP port 6379)? [y/N]: " tls_only
msg_info "Configuring TLS for Valkey..." msg_info "Configuring TLS for Valkey..."
create_self_signed_cert "Valkey"
TLS_DIR="/etc/ssl/valkey" TLS_DIR="/etc/ssl/valkey"
mkdir -p "$TLS_DIR"
$STD openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 \
-subj "/CN=Valkey" \
-addext "subjectAltName=DNS:Valkey" \
-keyout "$TLS_DIR/valkey.key" \
-out "$TLS_DIR/valkey.crt"
chmod 600 "$TLS_DIR/valkey.key"
chmod 644 "$TLS_DIR/valkey.crt"
chown valkey:valkey "$TLS_DIR/valkey.crt" "$TLS_DIR/valkey.key" chown valkey:valkey "$TLS_DIR/valkey.crt" "$TLS_DIR/valkey.key"
if [[ ${tls_only,,} =~ ^(y|yes)$ ]]; then if [[ ${tls_only,,} =~ ^(y|yes)$ ]]; then