Skip to content

[2.0] Fixes #37552: Verify MySQL sslConfig certificates and reject invalid sslConfig - #37633

Merged
ulixius9 merged 1 commit into
2.0from
backport-37553-2.0
Nov 12, 2026
Merged

ulixius9 merged 1 commit into
2.0from
backport-37553-2.0

Conversation

@ulixius9

Copy link
Copy Markdown
Member

Describe your changes:

Backport of #37553 to 2.0 (cherry-pick of f28197e). Fixes #37552.

  • Ingestion: SSLManager now passes the sslConfig cert files to PyMySQL as ca/cert/key (it was ssl_ca/ssl_cert/ssl_key, which PyMySQL ignores inside the ssl dict). Before this fix, MySQL/Doris/StarRocks connections used TLS but never verified the server certificate.
  • Server: an unrecognised sslConfig (e.g. {"sslMode": "require"} on MySQL) is now rejected with a 400 on create/update. Before, it was saved and then crashed the ingestion runner.

See #37553 for the full description and the end-to-end TLS test matrix.

Conflicts resolved for 2.0

  • ServiceEntityRepository.prepare: 2.0 has encryptServiceConnectionConfig, not main's prepareServiceConnectionConfig (Fixes #36586: Defer external service secret writes #36587 isn't on 2.0). The validation call wraps 2.0's method instead.
  • ssl_manager.py: kept 2.0's Union[...] cast style; only the comment and key names changed.
  • DatabaseServiceResourceIT: added the org.openmetadata.sdk.exceptions.OpenMetadataException import, which main already had.

Behaviour change (same as on main): if a service already has an invalid sslConfig stored, its next PUT/PATCH returns 400 unless the same request fixes sslConfig. GET and list still work.

Type of change:

  • Bug fix

Tests (run on this branch, against 2.0):

  • pytest tests/unit/test_ssl_manager.py tests/unit/source/database/test_mysql_iam.py: 59 passed
  • mvn test -pl openmetadata-service -Dtest=SecretsUtilSslConfigTest: 4 passed
  • DatabaseServiceResourceIT#post_mysqlService* (mysql-elasticsearch, parallel lane): 2 passed
  • ruff check/ruff format --check and spotless:check clean

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective.

🤖 Generated with Claude Code

…sslConfig (#37553)

* Fixes #37552: Verify MySQL sslConfig certificates and reject invalid sslConfig

SSLManager passed the sslConfig file paths to PyMySQL as ssl_ca/ssl_cert/ssl_key,
keys the ssl dict ignores, so MySQL, Doris and StarRocks connected over TLS
without verifying the server and without presenting client certificates. Use
PyMySQL's ca/cert/key keys.

sslConfig is a oneOf, so the converters kept any map they could not type and the
server saved configs (e.g. sslMode on MySQL) that the ingestion runner refused to
load. Reject them with a 400 on service create/update; reads stay lenient so
already-stored configs can still be fixed.

* Test valid sslConfig on MySQL only in the IT

Java DatabaseServiceType constants from Databricks onward carry the next
service's value on main (javaEnums is missing Clickzetta), so the SDK sends
MongoDB as SapSuccessFactors. The untyped-map case stays covered by
SecretsUtilSslConfigTest.

(cherry picked from commit f28197e)
@ulixius9
ulixius9 requested review from a team as code owners November 12, 2026 07:08
@ulixius9
ulixius9 requested review from Khairajani and pmbrull and removed request for a team November 12, 2026 07:08
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Passing CA certificates under PyMySQL's recognized keys enables server verification, so untrusted or mismatched certificates may prevent database connections.

Backport of the MySQL sslConfig fix to 2.0: the ingestion SSLManager now passes CA, cert, and key to PyMySQL under the correct ca/cert/key names so server certificates are verified, and the server rejects unrecognised sslConfig with a 400 on create and update. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Nov 12, 2026
@ulixius9
ulixius9 merged commit 0155af6 into 2.0 Nov 12, 2026
73 of 84 checks passed
@ulixius9
ulixius9 deleted the backport-37553-2.0 branch November 12, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants