Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clickhouse disable tls: non-nullable #1331

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading