Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k5ECN-0006GA-0X for pgsql-general@arkaria.postgresql.org; Mon, 10 Aug 2020 20:15:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k5ECL-0000NV-Qw for pgsql-general@arkaria.postgresql.org; Mon, 10 Aug 2020 20:15:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k5ECL-0000NM-Iv for pgsql-general@lists.postgresql.org; Mon, 10 Aug 2020 20:15:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k5ECI-00059e-JL for pgsql-general@lists.postgresql.org; Mon, 10 Aug 2020 20:15:09 +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 07AKF3vp3252575; Mon, 10 Aug 2020 16:15:03 -0400 From: Tom Lane To: "David G. Johnston" cc: Shankar Bhaskaran , "pgsql-generallists.postgresql.org" Subject: Re: Certficates In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Mon, 10 Aug 2020 13:08:36 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3252573.1597090503.1@sss.pgh.pa.us> Date: Mon, 10 Aug 2020 16:15:03 -0400 Message-ID: <3252574.1597090503@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Mon, Aug 10, 2020 at 10:54 AM Shankar Bhaskaran > wrote: >> How does psql import the server certificate? > It works by default because both the server and client are usually > installed from the same source and the same default certificate files are > provided to each. Actually I suspect the answer is "it works because the default behavior is to just encrypt the connection, not to try to verify the server certificate". If you want it to fail when it doesn't recognize the server cert, you need sslmode=verify-ca or sslosslmode=verify-full in your connection string. See sslmode here: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS regards, tom lane