Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiLKX-0069lK-4Z for pgsql-general@arkaria.postgresql.org; Mon, 18 Sep 2023 20:58:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qiLKV-003Z5x-FJ for pgsql-general@arkaria.postgresql.org; Mon, 18 Sep 2023 20:58:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiKRt-003I4k-Hr for pgsql-general@lists.postgresql.org; Mon, 18 Sep 2023 20:02:25 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiKRq-005xmo-Jf for pgsql-general@lists.postgresql.org; Mon, 18 Sep 2023 20:02:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 38IK2LgN228334; Mon, 18 Sep 2023 16:02:21 -0400 From: Tom Lane To: "Johnson, Bruce E - (bjohnson)" cc: "pgsql-general@lists.postgresql.org" Subject: Re: Connection not allowed because of an error 'Not in pg_hba.conf' In-reply-to: <65A32E9A-A82B-4968-9CE9-09C21AAE6CC0@arizona.edu> References: <65A32E9A-A82B-4968-9CE9-09C21AAE6CC0@arizona.edu> Comments: In-reply-to "Johnson, Bruce E - (bjohnson)" message dated "Mon, 18 Sep 2023 19:45:36 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <228332.1695067341.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 18 Sep 2023 16:02:21 -0400 Message-ID: <228333.1695067341@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Johnson, Bruce E - (bjohnson)" writes: > The error I am getting on the client is: > password authentication failed for user "trav" > connection to server at "dhbpostgres.pharmacy.arizona.edu" (10.128.206.1= 09), port 5432 failed: FATAL: no pg_hba.conf entry for host "10.128.206.1= 09", user "trav", database "webdata", no encryption > But I do have an entry that should allow it: > #Internal server mgmt range > hostssl all all 10.128.206.0/23 password I think what you are seeing here is two separate connection attempts. libpq will try an SSL connection, and that one is seemingly failing with a bad password. Then it'll try a non-SSL connection, and that one is getting rejected by the server because "hostssl" doesn't permit it, leading to your second message (which clearly shows that that connection wasn't ssl-encrypted). You could adjust your connection parameters on the client side to prevent the useless non-SSL connection attempt. But of course the real question is how come the password authentication failed in the first attempt. Looking into the server's log might yield a clue. regards, tom lane