From f39582c900fda9e26d3ca48287d516f44a002aae Mon Sep 17 00:00:00 2001 From: "Hugh A. Miles II" Date: Mon, 12 Jul 2021 15:38:07 -0700 Subject: [PATCH] fix: change sslmode to require for Postgres (#15642) * change sslmode to require * fix test --- superset/db_engine_specs/postgres.py | 2 +- tests/integration_tests/db_engine_specs/postgres_tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/db_engine_specs/postgres.py b/superset/db_engine_specs/postgres.py index ee95d5dd3d..c7984e6e66 100644 --- a/superset/db_engine_specs/postgres.py +++ b/superset/db_engine_specs/postgres.py @@ -186,7 +186,7 @@ class PostgresEngineSpec(PostgresBaseEngineSpec, BasicParametersMixin): "postgresql://user:password@host:port/dbname[?key=value&key=value...]" ) # https://www.postgresql.org/docs/9.1/libpq-ssl.html#LIBQ-SSL-CERTIFICATES - encryption_parameters = {"sslmode": "verify-ca"} + encryption_parameters = {"sslmode": "require"} max_column_name_length = 63 try_remove_schema_from_table_name = False diff --git a/tests/integration_tests/db_engine_specs/postgres_tests.py b/tests/integration_tests/db_engine_specs/postgres_tests.py index 283398d474..230eaf92cc 100644 --- a/tests/integration_tests/db_engine_specs/postgres_tests.py +++ b/tests/integration_tests/db_engine_specs/postgres_tests.py @@ -460,7 +460,7 @@ def test_base_parameters_mixin(): ) assert sqlalchemy_uri == ( "postgresql+psycopg2://username:password@localhost:5432/dbname?" - "foo=bar&sslmode=verify-ca" + "foo=bar&sslmode=require" ) parameters_from_uri = PostgresEngineSpec.get_parameters_from_uri(sqlalchemy_uri)