PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> When connecting to a PostgreSQL server (version 14) configured to only
> accept SSL connections, if a user provides an incorrect password, the psql
> client (version 14) returns two error messages in succession. The first
> message correctly indicates a password authentication failure, but the
> second suggests an unexpected non-SSL connection attempt.
This is libpq's (not psql's) default behavior. If you don't like it,
you need to set the sslmode parameter in the connection string to prevent
non-SSL connection attempts. See
https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS
regards, tom lane