Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7Ktw-0000ip-39 for pgsql-general@arkaria.postgresql.org; Fri, 22 Mar 2019 14:12:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h7Ktu-0000XV-P1 for pgsql-general@arkaria.postgresql.org; Fri, 22 Mar 2019 14:12:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7Ktu-0000Op-GQ for pgsql-general@lists.postgresql.org; Fri, 22 Mar 2019 14:12:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7Ktr-0007IW-Eg for pgsql-general@postgresql.org; Fri, 22 Mar 2019 14:12:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2MEBmsc025069; Fri, 22 Mar 2019 10:11:48 -0400 From: Tom Lane To: "Andrus" cc: "pgsql-general" Subject: Re: How to check is connection encrypted In-reply-to: <08F9F2EFA2AC46249CEDA929B773BCB9@dell2> References: <08F9F2EFA2AC46249CEDA929B773BCB9@dell2> Comments: In-reply-to "Andrus" message dated "Fri, 22 Mar 2019 11:00:49 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25067.1553263908.1@sss.pgh.pa.us> Date: Fri, 22 Mar 2019 10:11:48 -0400 Message-ID: <25068.1553263908@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Andrus" writes: > Client accesses server from Windows 10 using psqlODBC driver with > sslmode=allow in connection string. > How to verify that connection is encrypted ? When using libpq directly, you could use PQsslInUse(), or PQsslAttribute() for more detailed info. I'm not sure if ODBC provides any way to get at that. Or, if you want to check/enforce this from the server side, you could enable log_connections and see what's logged; or simply change pg_hba.conf to disallow non-SSL connections. regards, tom lane