Skip to content

Commit 6568dff

Browse files
authored
Add SSLMODE to database connection properties
Defaulting to SSLMODE=prefer, optional override using environment variable: DB_SSLMODE
1 parent 8d71d2f commit 6568dff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

configuration/configuration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def read_secret(secret_name):
3737
# PostgreSQL password
3838
'HOST': os.environ.get('DB_HOST', 'localhost'), # Database server
3939
'PORT': os.environ.get('DB_PORT', ''), # Database port (leave blank for default)
40+
'OPTIONS': {'sslmode': os.environ.get('DB_SSLMODE', 'prefer')},
41+
# Database connection SSLMODE
4042
}
4143

4244
# This key is used for secure generation of random numbers and strings. It must never be exposed outside of this file.

0 commit comments

Comments
 (0)