Closed sma closed 1 month ago
@sma: thanks for the analysis. As you are already deep debugging the code, would you be interested in writing a patch (and maybe a test) for it?
@sma: I also have this branch where I started to add configurable encoding, which may be a related area: https://github.com/isoos/postgresql-dart/tree/encoding
I believe this has been fixed.
I'm using version 2.4.3 with Dart 2.18.0-149.0.dev on macOS_x86
I can connect if I change the
ü
tou
, so I'm pretty sure it's the password that isn't accepted. I can successfully connect using thepg
package with Node.js so I'm sure that PostgreSQL correctly supports passwords with unicode letters. This package, unfortunately, does not.Here's my code:
Here's how I start a test database using Docker:
According to the documentation on Dockerhub, scram-sha-256 authentication will be used/required. I tried to debug that handshake process and at least checked that
SaslPrep.saslprep
will correctly normalize the password, using codeunit 252 for ü.If I have to guess, I'd say that you're supposed to UTF-8 encode the password before digesting it which isn't done. Here's the relevant code in the Node.js implementation.
password
is a string. And I verified thatupdate(String)
will automatically UTF-8 encode its argument.