From 8655732abf8730dd20a58446c5d8174ded1f4118 Mon Sep 17 00:00:00 2001 From: Jonathan Piron <> Date: Wed, 13 May 2020 14:44:07 +0200 Subject: [PATCH] Add stunnel certificate custom location support --- stunnel/docker-entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stunnel/docker-entrypoint.sh b/stunnel/docker-entrypoint.sh index de0c8ef5d..87bd633bb 100755 --- a/stunnel/docker-entrypoint.sh +++ b/stunnel/docker-entrypoint.sh @@ -8,7 +8,7 @@ setuid = stunnel setgid = stunnel socket = l:TCP_NODELAY=1 socket = r:TCP_NODELAY=1 -cert = /etc/stunnel/stunnel.pem +cert = ${CERT:=/etc/stunnel/stunnel.pem} client = ${CLIENT:-no} [${SERVICE}] @@ -16,11 +16,11 @@ accept = ${ACCEPT} connect = ${CONNECT} _EOF_ -if ! [ -f stunnel.pem ] +if ! [ -f "${CERT}" ] then openssl req -x509 -nodes -newkey rsa:2048 -days 3650 -subj '/CN=stunnel' \ - -keyout stunnel.pem -out stunnel.pem - chmod 600 stunnel.pem + -keyout "${CERT}" -out "${CERT}" + chmod 600 "${CERT}" fi exec stunnel "$@"