From 6568dff8e1e196e7774448e58801d7bd8a4c3a08 Mon Sep 17 00:00:00 2001 From: Stefan de Kooter Date: Wed, 6 Nov 2019 10:26:29 +0100 Subject: [PATCH] Add SSLMODE to database connection properties Defaulting to SSLMODE=prefer, optional override using environment variable: DB_SSLMODE --- configuration/configuration.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration/configuration.py b/configuration/configuration.py index 14c5d83..23170e8 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -37,6 +37,8 @@ DATABASE = { # PostgreSQL password 'HOST': os.environ.get('DB_HOST', 'localhost'), # Database server 'PORT': os.environ.get('DB_PORT', ''), # Database port (leave blank for default) + 'OPTIONS': {'sslmode': os.environ.get('DB_SSLMODE', 'prefer')}, + # Database connection SSLMODE } # This key is used for secure generation of random numbers and strings. It must never be exposed outside of this file.