Re: BUG #17216: No Password Provided Error - uncaught exception

Sehrope Sarkuni <sehrope@jackdb.com>

From: Sehrope Sarkuni <sehrope@jackdb.com>
To: Cliff Sizer <cliffsizer@gmail.com>
Cc: pgsql-jdbc@lists.postgresql.org
Date: 2021-10-08T12:44:26Z
Lists: pgsql-bugs
On Fri, Oct 8, 2021 at 12:25 AM Cliff Sizer <cliffsizer@gmail.com> wrote:

> When connecting to the pg database 14.0 and no password (empty) is
> specified the following error message is returned
> "Something unusual has occurred to cause the driver to fail. Please
> report this exception.  Empty value for ‘password’  "
>

This is a bug in the driver's handling of SCRAM authentication. We need to
add a check that a non-empty password has been provided by the user before
trying to use it.

The MD5 authentication handling has such a check. I think we just need to
copy it into the handling for the first SCRAM authentication request
message.

FYI, the driver does support SCRAM authentication, the issue here is it
does not gracefully handle the situation where the server requests SCRAM
authentication and the client's connection properties do not include a
password.

I've opened a GitHub issue for this error here:
https://github.com/pgjdbc/pgjdbc/issues/2288

Regards,
-- Sehrope Sarkuni
Founder & CEO | JackDB, Inc. | https://www.jackdb.com/