Fix: Enhance SSL support for PostgreSQL and MSSQL with mutual TLS configuration#27104
Fix: Enhance SSL support for PostgreSQL and MSSQL with mutual TLS configuration#27104SumanMaharana merged 9 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves ingestion-side SSL handling to support mutual TLS (CA + client cert + client key) across database and pipeline connectors, and adds unit tests to prevent regressions.
Changes:
- Forward client cert + key to psycopg2 connections (Postgres/Redshift/Greenplum) and pytds (MSSQL) via
SSLManager. - Refactor Hive and OpenLineage (Kafka) connectors to use
SSLManagertemp files rather than passing secret contents as file paths. - Add unit tests covering mutual TLS parameter wiring for Postgres/Redshift and MSSQL (pytds).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
ingestion/src/metadata/utils/ssl_manager.py |
Extracts + forwards cert/key for psycopg2 and pytds SSL args. |
ingestion/src/metadata/ingestion/source/database/hive/connection.py |
Removes direct sslConfig→driver-arg mapping and relies on SSLManager temp paths. |
ingestion/src/metadata/ingestion/source/pipeline/openlineage/connection.py |
Uses SSLManager temp paths for Kafka SSL configuration. |
ingestion/tests/unit/test_ssl_manager.py |
Adds unit tests for mutual TLS wiring for Postgres/Redshift and MSSQL (pytds). |
ingestion/src/metadata/ingestion/source/database/hive/connection.py
Outdated
Show resolved
Hide resolved
ingestion/src/metadata/ingestion/source/pipeline/openlineage/connection.py
Show resolved
Hide resolved
ingestion/src/metadata/ingestion/source/pipeline/openlineage/connection.py
Outdated
Show resolved
Hide resolved
…metadata/OpenMetadata into fix-postgres-ssl-handshake
ingestion/src/metadata/ingestion/source/pipeline/openlineage/connection.py
Outdated
Show resolved
Hide resolved
ingestion/src/metadata/ingestion/source/pipeline/openlineage/connection.py
Show resolved
Hide resolved
ingestion/src/metadata/ingestion/source/database/hive/connection.py
Outdated
Show resolved
Hide resolved
🟡 Playwright Results — all passed (26 flaky)✅ 3592 passed · ❌ 0 failed · 🟡 26 flaky · ⏭️ 207 skipped
🟡 26 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
ingestion/src/metadata/ingestion/source/database/hive/connection.py
Outdated
Show resolved
Hide resolved
ingestion/src/metadata/ingestion/source/pipeline/openlineage/connection.py
Show resolved
Hide resolved
Code Review ✅ Approved 1 resolved / 1 findingsEnhances SSL support for PostgreSQL and MSSQL with mutual TLS configuration, addressing the SSL temp files leak on Kafka connection failure. No issues found. ✅ 1 resolved✅ Bug: SSL temp files leak on Kafka connection failure
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
…figuration (open-metadata#27104) * feat: Enhance SSL support for PostgreSQL and MSSQL with mutual TLS configuration * address comments * address comments * address comments
…figuration (open-metadata#27104) * feat: Enhance SSL support for PostgreSQL and MSSQL with mutual TLS configuration * address comments * address comments * address comments



Describe your changes:
Fixes #27085
This pull request improves SSL and mutual TLS (client certificate) support across multiple database and pipeline connectors. The main focus is on ensuring that all relevant SSL certificate fields (CA, client cert, client key) are correctly extracted, handled, and passed to drivers for secure connections, especially for PostgreSQL, Redshift, and MSSQL (pytds), and Kafka. The changes also add comprehensive unit tests to verify these enhancements.
SSL/mutual TLS handling improvements:
SSLManagerand its usage to ensure all three SSL fields (CA certificate, client certificate, and client key) are extracted and passed to database drivers (PostgreSQL, Redshift, Greenplum, MSSQL/pytds) for proper mutual TLS authentication. Previously, only the CA certificate was handled, causing mutual TLS to silently fail. (ingestion/src/metadata/utils/ssl_manager.py[1] [2] [3]SSLManagerfor temporary file management of SSL certificates, avoiding direct assignment of secret values as file paths and preventing driver-level errors. (ingestion/src/metadata/ingestion/source/database/hive/connection.py[1]ingestion/src/metadata/ingestion/source/pipeline/openlineage/connection.py[2] [3]Testing enhancements:
ingestion/tests/unit/test_ssl_manager.pyingestion/tests/unit/test_ssl_manager.pyR653-R802)ingestion/tests/unit/test_ssl_manager.pyingestion/tests/unit/test_ssl_manager.pyR353-R383)These changes collectively ensure that mutual TLS (client certificate authentication) works reliably and as expected across supported connectors, and that the codebase is better tested for these scenarios.
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>