Skip to content

Fix and extend MySQL TLS modes for all sync paths - #132

Merged
mumoshu merged 12 commits into
mainfrom
mysql-tls-modes
Jul 23, 2026
Merged

Fix and extend MySQL TLS modes for all sync paths#132
mumoshu merged 12 commits into
mainfrom
mysql-tls-modes

Conversation

@mumoshu

@mumoshu mumoshu commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Binlog source already had --tls-mode options, but preferred and required often failed with typical self-signed MySQL setups, and trigger sync plus snapshots had no TLS settings.

This makes the three modes behave as users expect (including falling back to plain when preferred can’t encrypt), applies the same flags across MySQL/MariaDB trigger sync, binlog sync, and snapshots.

Intends to cover --tls-mode issues mentioned in #121

mumoshu added 11 commits July 23, 2026 06:05
Add disabled, preferred, and required connection modes with optional CA and client certificate flags, integration tests, and end-user documentation.
Ad-hoc snapshot signalling now uses the same TLS settings as sync, so encrypted connections work when adding tables to a running follower.
Preferred mode now retries without encryption only when the server cannot use TLS or the handshake fails, not on wrong passwords or other connection errors.
Cover client certificate authentication and MariaDB required/preferred TLS connections using the existing Docker TLS harness.
Replace the misnamed bad-CA test with a real MySQL instance that has TLS disabled, confirming required mode errors instead of connecting.
Explain when encryption does not verify the server, how preferred fallback works, and hostname/CA guidance for managed MySQL.
The trigger source crate already depends on binlog-protocol for production code; drop the redundant dev-dependencies line.
Document preferred fallback, CA verification, hostname guidance, and that snapshot uses the same flags; point MariaDB readers to both guides.
Note in CLI help and user docs that CA and client certificate paths apply only when TLS is enabled.
Restore zlib-backed protocol compression for mysql_async while keeping TLS enabled.
Comment thread crates/mysql-binlog-source/tests/suite/tls_modes.rs Fixed
Derive invalid credentials from the container password so auth-failure TLS tests stay realistic without triggering security scanning alerts.
@mumoshu
mumoshu merged commit c4a17c0 into main Jul 23, 2026
9 checks passed
@mumoshu
mumoshu deleted the mysql-tls-modes branch July 23, 2026 06:26
@mumoshu mumoshu mentioned this pull request Jul 23, 2026
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.

2 participants