From 3e7ecf887326a370daf48d9376f44589333abd73 Mon Sep 17 00:00:00 2001 From: Carlos Mogas da Silva Date: Mon, 4 Jun 2018 23:32:14 +0100 Subject: [PATCH] Remove existing certificate before creating the new one --- haraka.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/haraka.sh b/haraka.sh index f2b008a..0309186 100644 --- a/haraka.sh +++ b/haraka.sh @@ -19,6 +19,7 @@ if [ "${USE_LETSENCRYPT,,}" == "yes" -o "${USE_LETSENCRYPT,,}" == "true" ]; then ln -sf /etc/letsencrypt/live/$HOSTNAME/fullchain.pem tls-cert.pem else # Generate a self-signed certificate for the hostname provided + rm -f tls-key.pem tls-cert.pem openssl req -subj "/O=Self Signed Certificate/CN=$HOSTNAME" -new -newkey rsa:4096 -days 365 -nodes -x509 -sha256 -keyout tls-key.pem -out tls-cert.pem fi cd -