PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> 5) get double error on client side:
That's normal behavior, if you're using an SSL-capable libpq over a TCP
socket; it will try once with SSL and once without. (This isn't quite
as insane as it perhaps sounds, because the server might have different
pg_hba rules for the two cases.) If you don't want that, you can force
the matter using the sslmode connection option.
regards, tom lane