Fixed DB SSL mode on web images

This commit is contained in:
Alexey Pustovalov 2026-05-05 11:32:39 +09:00
parent 439b15bfed
commit 522389441d
2 changed files with 5 additions and 1 deletions

View file

@ -29,6 +29,8 @@ set_mysql_cli() {
set_mysql_tls_args() {
MYSQL_TLS_ARGS=()
[ "${ZBX_DB_ENCRYPTION:-}" = "true" ] && export ZBX_DBTLSCONNECT=required
if [ -n "${ZBX_DBTLSCONNECT:-}" ]; then
if [ "${DB_ENGINE}" = "mariadb" ]; then
MYSQL_TLS_ARGS+=(--ssl)
@ -38,7 +40,7 @@ set_mysql_tls_args() {
fi
else
local ssl_mode="${ZBX_DBTLSCONNECT//verify_full/verify_identity}"
MYSQL_TLS_ARGS+=("--ssl=${ssl_mode}")
MYSQL_TLS_ARGS+=("--ssl-mode=${ssl_mode}")
fi
if [ -n "${ZBX_DBTLSCAFILE:-}" ]; then

View file

@ -10,6 +10,8 @@ set_pg_env() {
export PGOPTIONS="--search_path=${DB_SERVER_SCHEMA}"
fi
[ "${ZBX_DB_ENCRYPTION:-}" = "true" ] && export ZBX_DBTLSCONNECT=required
if [ -n "${ZBX_DBTLSCONNECT:-}" ]; then
local pg_sslmode
pg_sslmode="${ZBX_DBTLSCONNECT//_/-}"