-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Bun.sql: SCRAM-SHA-256-PLUS (channel binding) support #16700
base: main
Are you sure you want to change the base?
Conversation
Wow awesome.
@cirospaciari knows more than me about this, but I wonder if we need to pass This looks directionally good to me but we would need a test of some kind before we can merge it |
@cirospaciari I guess this may also be a bug report, then. :) If it set up a Postgres instance using the script above, with either
And in Postgres logs I see:
|
@jawj thank you for the PR, looks like CA is not being load, will investigate |
Thanks @cirospaciari. Once this is addressed I can continue to work on channel binding support. |
I already have some fix in-place but is not merged yet, I'm investigating and fixing another issue in postgres and after this probably tomorrow a PR will be made for it. Update: Still investigating the Issue |
What does this PR do?
Adds support for SCRAM-SHA-256-PLUS auth (i.e. tls-server-end-point channel binding) to Bun.sql, and uses it if the server offers it.
This is my first time reading or writing Zig, so it may be inelegant or even wrong in places.
How did you verify your code works?
I've done some manual testing locally using the OpenSSL test certs with this Docker script:
And this command:
I'm not sure the channel binding code as it currently stands would deal correctly with RSA-PSS or Ed25519 certificates. But I can't check this, because it seems Bun.sql doesn't support those certificates in the first place? (I get
ERR_POSTGRES_CONNECTION_CLOSED
locally andLOG: could not accept SSL connection: no suitable signature algorithm
in the Postgres logs when I use these, even using the unmodified Bun 1.2.0 release).I haven't written any automated tests so far. If you're otherwise willing to merge this, perhaps you could give a few pointers on these?