Bug Report: --db_ssl_mode=preferred
wrongly ignored on replication settings when unix domain sockets are used
#17216
Labels
Overview of the Issue
vt_app
), because they are connecting via unix domain sockets and those are deemed "secure" even without TLS/SSL encryption.We provide MySQL configuration to
vttablet
via CLI arguments like this:When
vttablet
sets up replication configuration viamysqlFlavor.setReplicationSourceCommand
, it calls out to*ConnParams.SslEnabled()
to check whether TLS should be enabled in the replication configuration.*ConnParams.SslEnabled()
returnsfalse
if a unix domain socket is configured via--db_socket
and--db_ssl_mode
is set topreferred
to simulate what MySQL is doing when connecting to a unix domain socket.This behaviour is correct when connections actually end up going over a domain socket. MySQL replica connections never go over the domain socket, they always use the hostname and port of the primary, so checking
*ConnParams.SslEnabled()
(which uses the global connection settings and sees that a socket is configured) is wrong in the context of the MySQL replication configuration.Workaround
We're currently setting
--db_ssl_mode=required
to work around this.Suggested Fix
Don't call
SslEnabled
inmysqlFlavor.setReplicationSourceCommand
, instead call*ConnParams.EffectiveSslMode
and enable SSL/TLS unless it's disabled.Reproduction Steps
n/a
Binary Version
Operating System and Environment details
Log Fragments
The text was updated successfully, but these errors were encountered: