Fixed SSL mode option for PostgreSQL

This commit is contained in:
Alexey Pustovalov 2022-05-25 01:49:10 +03:00
parent 2ec321e6de
commit ba129fd1fe
12 changed files with 48 additions and 24 deletions

View File

@ -182,7 +182,8 @@ check_db_connect_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -221,7 +222,8 @@ psql_query() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -256,7 +258,8 @@ create_db_database_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -304,7 +307,8 @@ create_db_schema_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -182,7 +182,8 @@ check_db_connect_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -221,7 +222,8 @@ psql_query() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -256,7 +258,8 @@ create_db_database_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -304,7 +307,8 @@ create_db_schema_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -182,7 +182,8 @@ check_db_connect_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -221,7 +222,8 @@ psql_query() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -256,7 +258,8 @@ create_db_database_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -304,7 +307,8 @@ create_db_schema_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -182,7 +182,8 @@ check_db_connect_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -221,7 +222,8 @@ psql_query() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -256,7 +258,8 @@ create_db_database_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
@ -304,7 +307,8 @@ create_db_schema_postgresql() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -99,7 +99,8 @@ check_db_connect() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -99,7 +99,8 @@ check_db_connect() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -99,7 +99,8 @@ check_db_connect() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -99,7 +99,8 @@ check_db_connect() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -99,7 +99,8 @@ check_db_connect() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -99,7 +99,8 @@ check_db_connect() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -99,7 +99,8 @@ check_db_connect() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}

View File

@ -99,7 +99,8 @@ check_db_connect() {
fi
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
export PGSSLMODE=${PGSSLMODE//required/require}
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
export PGSSLKEY=${ZBX_DBTLSKEYFILE}