diff --git a/flow/connectors/clickhouse/clickhouse.go b/flow/connectors/clickhouse/clickhouse.go index b4bf5b90e7..2390ad1109 100644 --- a/flow/connectors/clickhouse/clickhouse.go +++ b/flow/connectors/clickhouse/clickhouse.go @@ -138,9 +138,9 @@ func NewClickhouseConnector( } func connect(ctx context.Context, config *protos.ClickhouseConfig) (*sql.DB, error) { - tlsSetting := &tls.Config{MinVersion: tls.VersionTLS13} - if config.DisableTls != nil && *config.DisableTls { - tlsSetting = nil + var tlsSetting *tls.Config + if !config.DisableTls { + tlsSetting = &tls.Config{MinVersion: tls.VersionTLS13} } conn := clickhouse.OpenDB(&clickhouse.Options{ Addr: []string{fmt.Sprintf("%s:%d", config.Host, config.Port)}, diff --git a/nexus/analyzer/src/lib.rs b/nexus/analyzer/src/lib.rs index 213e266de1..9f67e38132 100644 --- a/nexus/analyzer/src/lib.rs +++ b/nexus/analyzer/src/lib.rs @@ -816,7 +816,8 @@ fn parse_db_options( .to_string(), disable_tls: opts .get("disable_tls") - .map(|s| s.parse::().unwrap_or_default()) + .and_then(|s| s.parse::().ok()) + .unwrap_or_default() }; let config = Config::ClickhouseConfig(clickhouse_config); Some(config) diff --git a/protos/peers.proto b/protos/peers.proto index fdba901ca2..063effc4da 100644 --- a/protos/peers.proto +++ b/protos/peers.proto @@ -97,7 +97,7 @@ message ClickhouseConfig{ string access_key_id = 7; string secret_access_key = 8; string region = 9; - optional bool disable_tls = 10; + bool disable_tls = 10; } message SqlServerConfig {