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 1hxE5M-0002K3-OZ for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2019 17:26:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hxE5J-0007js-IY for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Aug 2019 17:26:17 +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 1hxE5J-0007jl-AB for pgsql-hackers@lists.postgresql.org; Mon, 12 Aug 2019 17:26:17 +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 1hxE5G-0003e7-Q8; Mon, 12 Aug 2019 17:26:16 +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 x7CHQ6f2012895; Mon, 12 Aug 2019 13:26:06 -0400 From: Tom Lane To: Stephen Frost cc: Peter Eisentraut , Jeff Davis , "Jonathan S. Katz" , Michael Paquier , pgsql-hackers@postgresql.org Subject: Re: Add "password_protocol" connection parameter to libpq In-reply-to: <20190812171414.GX16436@tamriel.snowman.net> References: <20190809030021.GG3194@paquier.xyz> <3bbf5968ea705700a2605d6db74d8510bea7940b.camel@j-davis.com> <20190809100922.GI3194@paquier.xyz> <20190809132850.GL16436@tamriel.snowman.net> <609482826475e0063c7d71b2449ae31c0d61b232.camel@j-davis.com> <071e45a6-97f7-1614-371c-98ecb03aed65@postgresql.org> <7a7a2f07-d013-eb80-85ba-9edaaf845038@2ndquadrant.com> <95b40ddcb3897772f075e6891521ee3f06f443d1.camel@j-davis.com> <93653d2b-7cf7-6992-7d3e-600ffd461354@2ndquadrant.com> <20190812171414.GX16436@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Mon, 12 Aug 2019 13:14:15 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12893.1565630766.1@sss.pgh.pa.us> Date: Mon, 12 Aug 2019 13:26:06 -0400 Message-ID: <12894.1565630766@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > I'm not really thrilled with approach #2 because it means the user > will have to know which of the PG authentication methods involve, eg, > sending the password in the clear to the server, and which don't, if > what they're really looking for is "don't send my password in the clear > to the server" which seems like a really useful and sensible thing to > ask for. What problem do we actually need to solve here? If the known use-case is just "don't send my password in the clear", maybe we should just change libpq to refuse to do that, ie reject plain-password auth methods unless SSL is on (except maybe over unix sockets?). Or invent a bool connection option that enables exactly that. I'm not really convinced that there is a use-case for client side specification of allowed auth methods beyond that. In the end, if you don't trust the server you're connecting to to handle your password with reasonable safety, you have got bigger problems than this one. And we already have coverage for MITM problems (or if we don't, this sideshow isn't fixing it). regards, tom lane