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 1ii8cr-0000cE-PY for pgsql-pkg-yum@arkaria.postgresql.org; Fri, 20 Dec 2019 03:06:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ii8cq-0000Wx-2G for pgsql-pkg-yum@arkaria.postgresql.org; Fri, 20 Dec 2019 03:06:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ii8cp-0000Wp-NY for pgsql-pkg-yum@lists.postgresql.org; Fri, 20 Dec 2019 03:06:47 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ii8ci-0001B5-4q for pgsql-pkg-yum@lists.postgresql.org; Fri, 20 Dec 2019 03:06:46 +0000 Received: by mail-lj1-x231.google.com with SMTP id j1so1075167lja.2 for ; Thu, 19 Dec 2019 19:06:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yF4DSX4+lCZ97wlWeZ8cE4I4xqy75WIUvi2DB+ZtA8o=; b=o0GADqaUtOSPJfIGBJUm1riDaK/B7/oLbhtUqeAxJTVfcQZuX//hJ7PSrD5tsDuOK4 0+/LtyctkTCtwwxDQIyQzXD6J2GzSe98SA0gFJF/nkWOXUmRtEITCqLtvb4rn6MuPN2/ eZEB+MJEtkatyIhadBL+1ihFaTj9xgdtk/x4FVgFGwMWtAt72EGw+JDqfsbN04KzJgJZ QVBlmaHeSlEXsTeCsIZVDaUeTq4vQpCE/Ye1QkEjj3gpM7RLn3buLNn/WU00mYsa1Jyz DM9dvRkYZvyT1dBb7c0hCtbMaOqPu/63UzXIuB0HQd00N5OGCNcmv/Almry0uwkM48RE 5h1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yF4DSX4+lCZ97wlWeZ8cE4I4xqy75WIUvi2DB+ZtA8o=; b=hEBSzqabuIlz5AdCMRIFsPMU+fa4SaR88sKxQ6+DxXfni35YHB2N0jvR8rejRUosV4 Z5cTg0ULaXltand+tvPD7bNdHFdATkG6gCcD+5U0+PJWb4CwxUZ8Ux05X0LgEc/lULZB 7tYvYLM8j4KeK8xrAUGXmNYuzcKF5JR/rmco7RFVYIcv7WLeFewCKpp2Ze6YNFKy6kmD HbcVOxAZPptPn+Ei+zXwzKPdaWKAeq/DWgSkbndpid6jTD6u/mRy6bV7PIp7SJswg5pM AZ/RntzbgNkQxe6QZEaqheEj7bzBo5VeaqvtYj4y0ldzrk2M1zGIEikcp8CEsr9j4rbr DX1w== X-Gm-Message-State: APjAAAUZCJ1jD1oArHXsge6LsWJ2ThwT7VRhOfNrxdOfcuynVkn7hwnx ol5JS5LbVarxG3xrfoQBAOy6Q4xzhTt8Me1wVk0Shw== X-Google-Smtp-Source: APXvYqz581Pakzew6ZKdJDGc/rNWNUk6t2e877y9Q1Tmui4IikUotU8CBuMQETKh9ZNEBZt7QsGQD9cvCt3+x1Hyzz0= X-Received: by 2002:a2e:9596:: with SMTP id w22mr8106409ljh.21.1576811197635; Thu, 19 Dec 2019 19:06:37 -0800 (PST) MIME-Version: 1.0 References: <83bdce65-302f-49ef-828a-3831fe11d904@www.fastmail.com> <20191219165719.GC3195@tamriel.snowman.net> <02c6c7de-e2e2-48cd-94e7-7d65b7196ca5@www.fastmail.com> <20191219173228.GF3195@tamriel.snowman.net> In-Reply-To: <20191219173228.GF3195@tamriel.snowman.net> From: Craig Ringer Date: Fri, 20 Dec 2019 11:06:26 +0800 Message-ID: Subject: Re: Can we stop defaulting to 'ident'? To: Stephen Frost Cc: James Cassell , PostgreSQL Yum Package List Content-Type: multipart/alternative; boundary="00000000000050334f059a19f7d8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000050334f059a19f7d8 Content-Type: text/plain; charset="UTF-8" On Fri, 20 Dec 2019 at 01:32, Stephen Frost wrote: > Greetings, > > * James Cassell (fedoraproject@cyberpear.com) wrote: > > Peer does not work with TCP connections, and I haven't figured how to > get,e.g., third-party Java applications working without TCP. > > The entire point of peer was to segregate the very insecure 'ident' from > the actually quite secure 'peer' auth, so, no, it's not going to work > over TCP connections- that's more-or-less the point. > > Regarding a JDBC connection, you can pass in a "socketFactory", as I > understand it (though I'm no JDBC expert, I'd suggest you address issues > you have with that to the JDBC list): > > https://jdbc.postgresql.org/documentation/head/connect.html > Right. PgJDBC doesn't actually have to support it directly, since you can pass your own socketFactory, such as one provided by https://github.com/kohlschutter/junixsocket or https://github.com/jnr/jnr-unixsocket . As the Java Language specification does not provide for UNIX socket support and no widely used JVM bundles AF_UNIX socket support there's no way for PgJDBC to directly support unix sockets. We could add support for it in jdbc:postgresql:// URLs, but we'd have to do a runtime search of the classpath to find a suitable SocketFactory using a list of known unix socket library implementations ... so why bother? If the user has to install a 3rd party library to do it anyway, they can specify a JDBC URL argument too. So PgJDBC already has everything it needs there IMO, except perhaps a hint in the documentation. Patches welcome :) -- Craig Ringer http://www.2ndQuadrant.com/ 2ndQuadrant - PostgreSQL Solutions for the Enterprise --00000000000050334f059a19f7d8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, 20 Dec 2019 at 01:32, Stephen Fro= st <sfrost@snowman.net> wro= te:
Greetings,

* James Cassell (fedoraproject@cyberpear.com) wrote:
> Peer does not work with TCP connections, and I haven't figured how= to get,e.g., third-party Java applications working without TCP.

The entire point of peer was to segregate the very insecure 'ident'= from
the actually quite secure 'peer' auth, so, no, it's not going t= o work
over TCP connections- that's more-or-less the point.

Regarding a JDBC connection, you can pass in a "socketFactory", a= s I
understand it (though I'm no JDBC expert, I'd suggest you address i= ssues
you have with that to the JDBC list):

https://jdbc.postgresql.org/documentation= /head/connect.html

Right. PgJDBC do= esn't actually have to support it directly, since you can pass your own= socketFactory, such as one provided by=C2=A0https://github.com/kohlschutter/junixsocket o= r=C2=A0https://github.com= /jnr/jnr-unixsocket=C2=A0.

As the Java Languag= e specification does not provide for UNIX socket support and no widely used= JVM bundles AF_UNIX socket support there's no way for PgJDBC to direct= ly support unix sockets. We could add support for it in jdbc:postgresql:// = URLs, but we'd have to do a runtime search of the classpath to find a s= uitable SocketFactory using a list of known unix socket library implementat= ions ... so why bother? If the user has to install a 3rd party library to d= o it anyway, they can specify a JDBC URL argument too.

=
So PgJDBC already has everything it needs there IMO, except perhaps a = hint in the documentation. Patches welcome :)

-- =
=C2=A0Craig Ringer=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 http://= www.2ndQuadrant.com/
=C2=A02ndQuadrant - PostgreSQL Solutions for th= e Enterprise
--00000000000050334f059a19f7d8--