Skip to content

Commit

Permalink
clickhouse disable tls: non-nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 20, 2024
1 parent c0a8a3f commit 164bd83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions flow/connectors/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)},
Expand Down
3 changes: 2 additions & 1 deletion nexus/analyzer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,8 @@ fn parse_db_options(
.to_string(),
disable_tls: opts
.get("disable_tls")
.map(|s| s.parse::<bool>().unwrap_or_default())
.and_then(|s| s.parse::<bool>().ok())
.unwrap_or_default()
};
let config = Config::ClickhouseConfig(clickhouse_config);
Some(config)
Expand Down
2 changes: 1 addition & 1 deletion protos/peers.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 164bd83

Please sign in to comment.