Re: Libpq: Fail connection attempt if server didn't request a password - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Libpq: Fail connection attempt if server didn't request a password
Date
Msg-id 1686503.1610752878@sss.pgh.pa.us
Whole thread Raw
In response to Libpq: Fail connection attempt if server didn't request a password  (Adrian Vogelsgesang <avogelsgesang@tableau.com>)
List pgsql-interfaces
Adrian Vogelsgesang <avogelsgesang@tableau.com> writes:
> Is there some way to let libpq fail the connection attempt in such a case, i.e. if a password was provided but not
requestedfrom the server? 

Why would that be a useful thing to do?

> 1. To identify misconfigured server. In our use case, all servers should require a password. By failing hard and
early,we can more easily find misconfigured servers 

I find that argument quite unconvincing.  You can easily look into
pg_hba.conf to see if any lines don't have an auth method you like.
Moreover, that approach scales to requirements that are more complicated
than this specific use-case, and you can be sure that *all* the entries
satisfy your business rule, not just the one you happened to match this
time.

> Can I, as the client, force the authentication used during creating a connection to be scram-sha-256?

There has been discussion of that, but no one has written a patch yet.

            regards, tom lane



pgsql-interfaces by date:

Previous
From: Adrian Vogelsgesang
Date:
Subject: Libpq: Fail connection attempt if server didn't request a password
Next
From: Peter Eisentraut
Date:
Subject: Re: #include present twice in define.pgc