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

Allow optional HTTP headers; For HTTPS connections, pass auth as headers #811

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

tonickkozlov
Copy link
Contributor

@tonickkozlov tonickkozlov commented Nov 4, 2022

Some proxies require additional headers to be passed with HTTP requests in order to work correctly.
Additionally, in HTTPS mode IMO it makes sense to pass username and password as headers by default, since the URLs are not incrypted.

@gingerwizard
Copy link
Collaborator

@tonickkozlov great catch url creds in url. Appreciate. If tests pass I'll merge.

@tonickkozlov
Copy link
Contributor Author

Thanks for taking a look @gingerwizard .
My comment above is not accurate - URLs are encrypted of course but can be logged by servers etc.
I'll work on getting the tests fixed.

@gingerwizard
Copy link
Collaborator

@tonickkozlov no need. cloud tests currently wont pass for external contributors. All tests pass.

@gingerwizard gingerwizard merged commit 2588a36 into ClickHouse:main Nov 17, 2022
@tonickkozlov
Copy link
Contributor Author

Thanks @gingerwizard .
I see the tests are failing on master :( That's not expected right? Could it be that Clickhouse Cloud instance doesn't actually respect X-Clickhouse-User and X-Clickhouse-Key headers?

@gingerwizard
Copy link
Collaborator

So it should work...but yes we seem to have a problem. Sorry been OOTO and may have merged pre-emptively. taking a look now @tonickkozlov

@gingerwizard
Copy link
Collaborator

This works locally over SSL secured cluster - can also also auth against a cluster with curl i.e.

curl -H "X-Clickhouse-User: default" -H "X-Clickhouse-Key: blurb" --data-binary 'SELECT 1' https://awi597fyap.eu-west-1.aws.clickhouse.cloud:8443

@gingerwizard
Copy link
Collaborator

gingerwizard commented Nov 19, 2022

I see the issue. Headers aren't being used across all calls. Will PR.

@gingerwizard
Copy link
Collaborator

#820 @tonickkozlov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants