Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions stunnel/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ 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}]
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 "$@"