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

Support SASL and SCRAM-SHA-256 #123

Open
gtrak opened this issue May 31, 2022 · 0 comments
Open

Support SASL and SCRAM-SHA-256 #123

gtrak opened this issue May 31, 2022 · 0 comments

Comments

@gtrak
Copy link
Contributor

gtrak commented May 31, 2022

SASL has been around for a long time, but it's now become the default in common postgresql 14 distributions, and we don't support it.
#122 Turned a hang into a clear error, but it sucks that pgx won't work out of the box going forward until we fix this. It puts extra requirements on the server config to have to switch back to MD5, and it might conflict with user security requirements.

Here is a reference implementation of how to do the password handshake: https://github.com/porsager/postgres/blob/master/src/connection.js#L659

I think we could bring in nocrypto or hacl* for this, but I'm not sure how involved it is. We probably would need to use C bindings, but we wouldn't want to add a dependency to the OS for this.
pbkdf: https://github.com/abeaumont/ocaml-pbkdf
sha256:
https://ocaml.org/p/hacl-star/0.4.1/doc/Hacl_star/Hacl/index.html
https://docs.mirage.io/nocrypto/Nocrypto/Hash/SHA256/index.html

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

No branches or pull requests

1 participant