Skip to content

fix(connections): refuse Verify CA without a CA certificate on Kafka, Oracle and Teradata - #3171

Merged
datlechin merged 3 commits into
mainfrom
fix/verify-ca-without-ca-kafka-oracle-teradata
Sep 28, 2026
Merged

datlechin merged 3 commits into
mainfrom
fix/verify-ca-without-ca-kafka-oracle-teradata

Conversation

@datlechin

Copy link
Copy Markdown
Member

Found while fixing #3166 (#3168). The Trino and ClickHouse half of the same defect is fixed in #3168.

Root cause

With SSL Mode Verify CA and no CA certificate file, these drivers checked the server certificate against the system roots with no hostname check. So any publicly trusted certificate, for any host, was accepted:

  • Kafka: nio-ssl .noHostnameVerification with the default trust roots (KafkaConnection.swift).
  • Oracle: the same nio-ssl path, through the shared TableProOracleCore (OracleTLSMapper.swift). The iOS app uses it too.
  • Teradata: SecPolicyCreateSSL(true, nil) with no anchors (TeradataTLSTransport.swift). An unreadable CA file also silently widened to the system roots, in both verify modes.

The macOS form blocks Verify CA without a CA, but deep links, URL import (sslmode=verify-ca has no CA parameter), sync and older saved connections reach the drivers anyway. libpq refuses the same combination ("weak sslmode may not be used with sslrootcert=system").

What changed

Each driver refuses Verify CA with no (trimmed-empty) CA path before any network I/O, with a message that says what to do:

  • Kafka: KafkaError.verifyCaNeedsCertificate. The check runs in makeSSLContext, which every broker dial goes through, and once at the top of KafkaCluster.connect(), so the error is not repeated per bootstrap server.
  • Oracle: OracleCoreError.certificateAuthorityRequired from OracleTLSMapper. Blank CA paths now count as missing.
  • Teradata: the plugin mapping refuses it with a localized error. The core computes a TeradataTrustPolicy in init, before the NWConnection exists, so "system roots without a hostname" can no longer be expressed. An unreadable or non-certificate CA file now throws its own error, in both verify modes, checked before the missing-CA case.
  • macOS message: one shared key: "Verify CA needs a CA certificate. Choose the CA certificate that signed the server's certificate." It does not suggest Verify Identity, because the macOS form still requires a CA for Verify Identity on these three drivers.

iOS (Oracle):

  • The iOS Oracle form has no CA field, so Verify CA is removed from the picker for new Oracle connections.
  • A connection already saved or synced with Verify CA still shows it, and gets a footer and a driver message that are true on that device: set SSL Mode to Verify Identity. Removing the option outright would leave an invalid selection, or rewrite a Mac-synced connection's mode on the next iOS save.
  • Keys are in both catalogs, and verifyCa is dropped from the iOS Oracle integration test config.

Verify Identity with no CA keeps working on all three drivers: the system trust store plus a hostname check.

Verification

  • verify.sh build: PASS. verify.sh plugins (AllPlugins, which compiles the registry-only Kafka, Oracle and Teradata plugins): PASS.
  • TableProTests: 109/109 across 8 Kafka and Teradata suites, including the new KafkaTLSConfigurationTests (6) and TeradataSSLMappingTests (5).
  • swift test TableProOracle: 183/183, including 4 new OracleTLSMapperTests and 1 in OracleCoreErrorMessageTests. TableProCore --filter Teradata: 62/62, including 7 new TeradataTLSTests.
  • Fails without the fix: with it reverted and the tests kept, the new Oracle mapper tests and both Teradata "before opening a socket" tests fail. In that Teradata run, a Verify CA connection to 127.0.0.1:443 got through TLS to an HTTP 404, which is the defect reproduced.
  • iOS simulator (ARCHS=arm64, CODE_SIGNING_ALLOWED=NO): 34/34, including 6 new form and mapping cases.
  • swiftlint --strict on the changed files: clean apart from 4 existing violations in ConnectionFormViewModel.swift that the base file already has. check-ios-shared-isolation.py and the docs checks pass.

Not changed, reported

  • SQL Server: Verify CA checks the chain against /etc/ssl/cert.pem with check certificate hostname = no, and the form has no CA field. Same fail-open, left as a follow-up.
  • MongoDB and Redis: they only fail closed today because OpenSSL's default CA path does not exist on users' Macs. Separately, Redis never checks the hostname, even under Verify Identity (hiredis_ssl has no hostname-check symbols).

Reviewed by the design critique that preceded implementation (Codex is out of quota until 2026-09-29). The critique found the iOS Oracle impact.

@mintlify

mintlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
TablePro 🟢 Ready View Preview Sep 28, 2026, 7:55 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

…-ca-kafka-oracle-teradata

# Conflicts:
#	CHANGELOG.md
…-ca-kafka-oracle-teradata

# Conflicts:
#	CHANGELOG.md
@datlechin
datlechin merged commit e3ca652 into main Sep 28, 2026
8 checks passed
@datlechin
datlechin deleted the fix/verify-ca-without-ca-kafka-oracle-teradata branch September 28, 2026 19:58

This branch was successfully deployed

1 active deployment
staging - docs — 795488d0 Deployed Sep 28, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant