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 1tQa9z-003dp7-5s for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Dec 2024 22:47:23 +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 1tQa9y-00GJyQ-4P for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Dec 2024 22:47:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tQa9x-00GJxT-Ns for pgsql-bugs@lists.postgresql.org; Wed, 25 Dec 2024 22:47:21 +0000 Received: from smtprelay03.ispgateway.de ([80.67.29.5]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tQa9v-000Z4Q-20 for pgsql-bugs@lists.postgresql.org; Wed, 25 Dec 2024 22:47:20 +0000 Received: from [78.43.243.63] (helo=[192.168.178.53]) by smtprelay03.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98) (envelope-from ) id 1tQaAF-000000005p6-2B2E; Wed, 25 Dec 2024 23:47:39 +0100 Content-Type: multipart/alternative; boundary="------------6JeENwZOEcfSo3xQMvqxRWJ2" Message-ID: <5fc24305-136e-4a6e-993e-b10dc2300403@headcrashing.eu> Date: Wed, 25 Dec 2024 23:47:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: psql v16.3 successfully connects via TLSv1.3 proxy, but psql v16.4 says "tlsv1 alert no application protocol" To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org References: <68ff85d7-9b41-40ec-bddf-0ca74fe09875@headcrashing.eu> <2bfb5b13-63d7-4bce-96b4-8e075fe7d97a@iki.fi> <8a8cba41-fa82-492b-8500-a7538e5d5cf7@headcrashing.eu> <81360110-1708-4126-8c0d-333ead43a6df@headcrashing.eu> <1807243.1735155420@sss.pgh.pa.us> From: Markus KARG In-Reply-To: <1807243.1735155420@sss.pgh.pa.us> X-Df-Sender: bWFya3VzQGhlYWRjcmFzaGluZy5ldQ== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------6JeENwZOEcfSo3xQMvqxRWJ2 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > Markus KARG writes: >> Following this theory, sslnegotiation=postgres used with psql v17.x >> should solve the problem, as it falls back to the same mechanism >> supported in v16.3, correct? > No, sorry, it looks like we insert the ALPN extension into the SSL > request packet regardless of that. Maybe there should have been > a way to suppress that, but v17 libpq doesn't provide one. Thank you, Tom, you saved my day! I have explicitly added the name `postgresql` to the ALPN configuration on Traefik, and immediately psql v16.4+ (including psql v17) worked like a charm! As a reference for others, in `traefik-dynamic.yaml` add the follwing to make it work (as long as you patch the `default` TLS options, take care to keep all those protocols contained; alternative path a per-router tls config instead to ONLY have postgresql in that list):     ## Dynamic configuration     tls:       options:         default:           alpnProtocols:             - acme-tls/1             - http/1.1             - h2             - postgresql >> Regarding your question: I have tried "sslnegotiation=postgres" and >> "ssqlnegotiation=direct" with the original official PostgreSQL Docker >> Container found on Docker Hub. > Let's clarify something here: there is nothing "official" about either > that docker container or anything else you might find on DockerHub. > The Postgres community does not produce any such packaging. You'd > have to discussion the inclusion of v17 libpq with whoever did build > that container. I know that Debian thinks it's a good idea to use > latest libpq with older servers, and this builder might be following > their lead. (The timing would be about right, since v17.0 came out > about the same time as 16.4.) This example does show that there > are pitfalls in that policy. Thanks a lot for this really essential information! In fact, the authors of that official docker image (they really call it that way) call themselves "The PostgreSQL Docker Community". This is totally misleading, as one understands that to be "The Docker Community withing the PostgreSQL Community", which it (apparently) is not. Instead, it seems that it actually is "The PostgreSQL Community at Docker, Inc.", people totally unrelated to the "real" PostgreSQL Community! Thanks a lot, Tom, for your kind help. You provided the best Christmas present this year! :-) --------------6JeENwZOEcfSo3xQMvqxRWJ2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Markus KARG <markus@headcrashing.eu> writes:
Following this theory, sslnegotiation=postgres used with psql v17.x 
should solve the problem, as it falls back to the same mechanism 
supported in v16.3, correct?
No, sorry, it looks like we insert the ALPN extension into the SSL
request packet regardless of that.  Maybe there should have been
a way to suppress that, but v17 libpq doesn't provide one.

Thank you, Tom, you saved my day! I have explicitly added the name `postgresql` to the ALPN configuration on Traefik, and immediately psql v16.4+ (including psql v17) worked like a charm!

As a reference for others, in `traefik-dynamic.yaml` add the follwing to make it work (as long as you patch the `default` TLS options, take care to keep all those protocols contained; alternative path a per-router tls config instead to ONLY have postgresql in that list):

    ## Dynamic configuration
    tls:
      options:
        default:
          alpnProtocols:
            - acme-tls/1
            - http/1.1
            - h2
            - postgresql

Regarding your question: I have tried "sslnegotiation=postgres" and 
"ssqlnegotiation=direct" with the original official PostgreSQL Docker 
Container found on Docker Hub.
Let's clarify something here: there is nothing "official" about either
that docker container or anything else you might find on DockerHub.
The Postgres community does not produce any such packaging.  You'd
have to discussion the inclusion of v17 libpq with whoever did build
that container.  I know that Debian thinks it's a good idea to use
latest libpq with older servers, and this builder might be following
their lead.  (The timing would be about right, since v17.0 came out
about the same time as 16.4.)  This example does show that there
are pitfalls in that policy.

Thanks a lot for this really essential information! In fact, the authors of that official docker image (they really call it that way) call themselves "The PostgreSQL Docker Community". This is totally misleading, as one understands that to be "The Docker Community withing the PostgreSQL Community", which it (apparently) is not. Instead, it seems that it actually is "The PostgreSQL Community at Docker, Inc.", people totally unrelated to the "real" PostgreSQL Community!

Thanks a lot, Tom, for your kind help. You provided the best Christmas present this year! :-)


    
--------------6JeENwZOEcfSo3xQMvqxRWJ2--