Add SSL certificates to the trusted CA store (#510)

This commit is contained in:
MtnBurrit0
2026-05-20 09:47:26 -06:00
committed by GitHub
parent 49c8b9338f
commit 0f514b177b
2 changed files with 10 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ ENV globalSettings__logRollBySizeLimit="1073741824"
# Add packages # Add packages
RUN apk add --no-cache \ RUN apk add --no-cache \
ca-certificates \
curl \ curl \
jq \ jq \
nginx \ nginx \

View File

@@ -83,6 +83,15 @@ if [ "$BW_ENABLE_SSL" = "true" ] && [ ! -f /etc/bitwarden/${BW_SSL_KEY:-ssl.key}
rm "$TMP_OPENSSL_CONF" rm "$TMP_OPENSSL_CONF"
fi fi
# Trust the configured SSL certificates
if [ "$BW_ENABLE_SSL" = "true" ]; then
cp /etc/bitwarden/${BW_SSL_CERT:-ssl.crt} /usr/local/share/ca-certificates/bitwarden.crt
if [ -f /etc/bitwarden/${BW_SSL_CA_CERT:-ca.crt} ]; then
cp /etc/bitwarden/${BW_SSL_CA_CERT:-ca.crt} /usr/local/share/ca-certificates/bitwarden-ca.crt
fi
update-ca-certificates >/dev/null
fi
# Launch a loop to rotate nginx logs on a daily basis # Launch a loop to rotate nginx logs on a daily basis
/bin/sh -c "/logrotate.sh loop >/dev/null 2>&1 &" /bin/sh -c "/logrotate.sh loop >/dev/null 2>&1 &"