Skip to content

Commit 5223894

Browse files
committed
Fixed DB SSL mode on web images
1 parent 439b15b commit 5223894

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

templates/entrypoints/lib/mysql.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ set_mysql_cli() {
2929
set_mysql_tls_args() {
3030
MYSQL_TLS_ARGS=()
3131

32+
[ "${ZBX_DB_ENCRYPTION:-}" = "true" ] && export ZBX_DBTLSCONNECT=required
33+
3234
if [ -n "${ZBX_DBTLSCONNECT:-}" ]; then
3335
if [ "${DB_ENGINE}" = "mariadb" ]; then
3436
MYSQL_TLS_ARGS+=(--ssl)
@@ -38,7 +40,7 @@ set_mysql_tls_args() {
3840
fi
3941
else
4042
local ssl_mode="${ZBX_DBTLSCONNECT//verify_full/verify_identity}"
41-
MYSQL_TLS_ARGS+=("--ssl=${ssl_mode}")
43+
MYSQL_TLS_ARGS+=("--ssl-mode=${ssl_mode}")
4244
fi
4345

4446
if [ -n "${ZBX_DBTLSCAFILE:-}" ]; then

templates/entrypoints/lib/pgsql.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ set_pg_env() {
1010
export PGOPTIONS="--search_path=${DB_SERVER_SCHEMA}"
1111
fi
1212

13+
[ "${ZBX_DB_ENCRYPTION:-}" = "true" ] && export ZBX_DBTLSCONNECT=required
14+
1315
if [ -n "${ZBX_DBTLSCONNECT:-}" ]; then
1416
local pg_sslmode
1517
pg_sslmode="${ZBX_DBTLSCONNECT//_/-}"

0 commit comments

Comments
 (0)