Skip to content

Commit

Permalink
Setting X-Clickhouse-SSL-Certificate-Auth off when password is set, a…
Browse files Browse the repository at this point in the history
…nd setting it to on otherwise (#1316)
  • Loading branch information
gogingersnap777 authored Jun 5, 2024
1 parent 7127f98 commit 3a49215
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conn_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ func dialHttp(ctx context.Context, addr string, num int, opt *Options) (*httpCon
headers["X-ClickHouse-User"] = opt.Auth.Username
if len(opt.Auth.Password) > 0 {
headers["X-ClickHouse-Key"] = opt.Auth.Password
headers["X-ClickHouse-SSL-Certificate-Auth"] = "off"
} else {
headers["X-ClickHouse-SSL-Certificate-Auth"] = "on"
}
}

Expand Down

0 comments on commit 3a49215

Please sign in to comment.