Skip to content

Add support for authentication via mTLS (authentication with TLS certificates) #227

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

Draft
wants to merge 19 commits into
base: async-await
Choose a base branch
from

Conversation

azat
Copy link
Contributor

@azat azat commented Apr 19, 2025

Note: blocked by #226 hence draft for now

mTLS (Mutual TLS, or mTLS for short, is a method for mutual authentication) allows you to authenticate on the server with client certificate.

Now clickhouse-rs supports it, for this you need to pass the following arguments for connection url:

  • ca_certificate
  • client_certificate
  • client_private_key

Some other things:

  • Support specifying TLS certificate via ca_certificate parameter in URL
  • Add missing TLS fields for Debug trait
  • Update section about TLS features in README
  • Extend CI coverage for TLS

azat added 19 commits April 15, 2025 22:53
Previously ClickhouseTransport::poll_next did not tries to process
packets if the server closed the connection, however there can be some
packet (likely Exception), that we need to pass to user.

Also this will avoid panic in case of missing Hello packet, i.e. in
case of credentials mismatch.
* fix-panic-on-hello:
  ci: set CLICKHOUSE_SKIP_USER_SETUP to avoid restricting default user
  Fix test_size_of expectation (the size should be 64 with alignment)
  Properly handle terminated connection by the server
  Ensure that Hello packet correctly received
@madchicken
Copy link

It would be very good to see this PR merged but I don't see any reaction from the author. I don;t see any commit/activity on github from him in the last year, so I doubt we will get some news here. Maybe we should fork this project @azat ?

@azat
Copy link
Contributor Author

azat commented May 7, 2025

Let's the maintainer more time, it is really hard to support open source projects after some time when you have full time job...

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

Successfully merging this pull request may close these issues.

2 participants