diff --git a/docs/en/reference/configuration.rst b/docs/en/reference/configuration.rst index d9f1bf68983..c17fb079a95 100644 --- a/docs/en/reference/configuration.rst +++ b/docs/en/reference/configuration.rst @@ -280,6 +280,8 @@ pdo_pgsql / pgsql - ``sslcrl`` (string): specifies the filename of the SSL certificate revocation list (CRL). See `https://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNECT-SSLCRL` +- ``gssencmode`` (string): Optional GSS-encrypted channel/GSSEncMode configuration. + See `https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-GSSENCMODE` - ``application_name`` (string): Name of the application that is connecting to database. Optional. It will be displayed at ``pg_stat_activity``. diff --git a/src/Driver/PDO/PgSQL/Driver.php b/src/Driver/PDO/PgSQL/Driver.php index 1c586d69d1f..5bfcd730c45 100644 --- a/src/Driver/PDO/PgSQL/Driver.php +++ b/src/Driver/PDO/PgSQL/Driver.php @@ -126,6 +126,10 @@ private function constructPdoDsn(array $params): string $dsn .= 'application_name=' . $params['application_name'] . ';'; } + if (isset($params['gssencmode'])) { + $dsn .= 'gssencmode=' . $params['gssencmode'] . ';'; + } + return $dsn; } } diff --git a/src/Driver/PgSQL/Driver.php b/src/Driver/PgSQL/Driver.php index 73c97cd81cf..6377499a760 100644 --- a/src/Driver/PgSQL/Driver.php +++ b/src/Driver/PgSQL/Driver.php @@ -72,6 +72,7 @@ private function constructConnectionString( 'user' => $params['user'] ?? null, 'password' => $params['password'] ?? null, 'sslmode' => $params['sslmode'] ?? null, + 'gssencmode' => $params['gssencmode'] ?? null, ], static fn ($value) => $value !== '' && $value !== null, );