Skip to content

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

Draft
azat wants to merge 19 commits into
suharev7:async-awaitfrom
azat-rust:mTLS-upstream
Draft

azat wants to merge 19 commits into
suharev7:async-awaitfrom
azat-rust:mTLS-upstream

Conversation

@azat

@azat azat commented Apr 19, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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

azat commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

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