dot

packages and services management
Log | Files | Refs | README

commit 829e9126ccb87e6e654ce74c0cfc68b52c222426
parent f598c8e3e74e806255ab71c4e07ad189c4efb317
Author: Josuah Demangeon <mail@josuah.net>
Date:   Thu, 22 Feb 2018 14:10:42 +0100

simpler tls config

Diffstat:
Mbin/tls | 32+++++++++++++++-----------------
Mskel/ngircd.conf | 8++++----
2 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/bin/tls b/bin/tls @@ -1,18 +1,16 @@ -#!/bin/sh -ex +#!/bin/sh -e -case "$1" in -(update) - [ "$#" -eq 2 ] || exec "$0" - - mkdir -p "$(dirname "$2")" - openssl req -x509 -newkey rsa:4096 -days 365 \ - -keyout "$2.key" -out "$2.pem" - chmod 400 "$2.key" - chmod 444 "$2.pem" - openssl dhparam -out "$2.dhp" 4096 - chmod 444 "$2.dhparams.pem" - ;; -(*) - echo 'usage: tls update <directory>' - ;; -esac +prefix="/var/tls/$1" + +[ "$#" -eq 1 ] || exec echo 'usage: tls <name>' + +mkdir -p "$(dirname "$prefix")" +set -x + +openssl req -x509 -newkey rsa:4096 -days 365 \ + -keyout "$prefix.key" -out "$prefix.pem" +chmod 400 "$prefix.key" +chmod 444 "$prefix.pem" + +openssl dhparam -out "$prefix.dhp" 4096 +chmod 444 "$prefix.dhp" diff --git a/skel/ngircd.conf b/skel/ngircd.conf @@ -6,7 +6,7 @@ Info = XXX MotdFile = /etc/ngircd/motd Network = XXX - Ports = 6667 + Ports = 6697 [Limits] MaxConnections = 128 @@ -30,9 +30,9 @@ [SSL] Ports = 6697 - CertFile = /var/ngircd/tls/XXX.pem - DHFile = /var/ngircd/tls/XXX.dhp - KeyFile = /var/ngircd/tls/XXX.key + CertFile = /var/tls/ngircd.pem + DHFile = /var/tls/ngircd.dhp + KeyFile = /var/tls/ngircd.key KeyFilePassword = XXX CipherList = XXX