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 1tQVZ8-00369j-N5 for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Dec 2024 17:53:03 +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 1tQVZ7-00F7Vv-SD for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Dec 2024 17:53:01 +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 1tQVZ7-00F7Vl-Iv for pgsql-bugs@lists.postgresql.org; Wed, 25 Dec 2024 17:53:01 +0000 Received: from lahtoruutu.iki.fi ([2a0b:5c81:1c1::37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tQVZ5-000XAl-20 for pgsql-bugs@lists.postgresql.org; Wed, 25 Dec 2024 17:53:00 +0000 Received: from [192.168.1.110] (dsl-hkibng22-50ddb7-241.dhcp.inet.fi [80.221.183.241]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4YJK9N0sD3z49Q16; Wed, 25 Dec 2024 19:52:55 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1735149176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3qfTlni9XX3wMSzcdG8tc8jwGYbKE4a4yDnQCiwJ6GU=; b=FAo9vxdnKWF9HvuU/Gy1Uhj5+qbOGJBsribkiZT3yccfU5jwAbHdBJFFopAOTBSXimhaUa NR0CuLvmfFMPqfM17z9rVkqJ1GvPS7VvawoblC2H79Yo/ErMCf7hvCjJgfjCbPLg8yky9g hu8RPR3augMz98bmHvNbwjm/8i8k/KYB7QTCf8RK/7bIiQ7kyfF9B/Q9hBSLvLqNUpJ1/S iYs5OjX+fJvClfVhCuPKnYJOn7IsAst/IgokB+ZvMRDYiOBAHMr2PbkLAvGZt+DGfMuEmQ ArEHWoKLbm8/v1IAeRnlwn1nyLuBRJfSQn2upKcacyr97f5S2PT7yIllTZtArg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1735149176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3qfTlni9XX3wMSzcdG8tc8jwGYbKE4a4yDnQCiwJ6GU=; b=vapbMHLVGtG8L+DXJB9B/JZNuAK/bD4WllQ53KzNWN8tiwgjl5oALR+5eJpC0pfMatwoPb /dZE9mwT21Kcyn9RG3q84di3WMp74U0LLdsSCyaLjE/JvL5+yEkcqROEnq43d80S3WhuVU Uqhg+R5sEslC5Ksdw/IG2tkeoJk8cu7/xCbw3rb5KAm8GpYzRVd3BNWztjDqCL7oles/PH otkJLESJjnaTPXNv5Gv6E/UgdmIhUSzZXfTFZPUhccsiP7pY712tYHfjEfoOcvT6s4VUHx H/XFfQyPffAb5pYyUwPM6j17kvmqe9/TanJ8XprReiIemacFRokKelZPVQ1xBg== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1735149176; a=rsa-sha256; cv=none; b=EmTKSPDcKMmuhiSZ1U+Ta/6kyGQGyfrxCqH+j6YmY2H0eMJ5A4kneA8Kw7VsHUYq/Xgy/X tf6DE5eMK0aKfhtMYGEQlrh4RGHdWkrIXySyJAGjJO6ZIm9qWqQZsmXKQUjYwLKgGckHJw PQQGkipca8Svn7Zije84zQmKrQpLm7BGc6GQnvmLrE6meCy6Zlwo3pS1764B80Njly2B04 2vkedOavSaMKRKpySGYnrTEebtbkRTaBHAIZGq9IDBZ4rz/6ceZYoIvxz1r4fHHvKJjnKc tU6rUwxFK7rFpLiI0Qgs7/rMdOlH1Zm74f2wbqDvPzG2m0ViXXOBb/qJVIDT/Q== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: <2bfb5b13-63d7-4bce-96b4-8e075fe7d97a@iki.fi> Date: Wed, 25 Dec 2024 19:52:55 +0200 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: Markus KARG , pgsql-bugs@lists.postgresql.org References: <68ff85d7-9b41-40ec-bddf-0ca74fe09875@headcrashing.eu> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: <68ff85d7-9b41-40ec-bddf-0ca74fe09875@headcrashing.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 25/12/2024 19:05, Markus KARG wrote: > I am running the official PostgreSQL 17.2 Docker Container (https:// > hub.docker.com/layers/library/postgres/17.2/images/sha256- > c063081175f45f4a3a5ac03c234e060e67618ebe75b49e2a7ffb79f8357bd1e6) > proxied by a TLSv1.3 proxy (official Traefik 3.2.3 Docker Container > https://hub.docker.com/layers/library/traefik/v3.2.3/images/ > sha256-06966a9ba1747ad724a490b8f27df1434c64e8eee5d681df03c4761c9653f62c). Traefik utilizes ACME with Let's Encrypt to produce the TLS certificate. In v17, libpq requests the ALPN extension in the TLS handshake. Looks like the proxy doesn't know about the "postgresql" ALPN protocol, and rejects the connection. I guess Traefik needs some configuration changes to tell it that the "postgresql" protocol is expected. Or code changes. > Using the official PostgresSQL Docker Container (16.3 vs 16.4+), I am > asking psql to connect to my server. While psql 16.3 and earlier > versions successfully connect via the TLS proxy to the PostgreSQL > server, psql 16.4 and later versions fail doing so: > > root@hetzner-2:~# docker run -it postgres:16.3 psql "host=headcrashing.eu port=5432 > dbname=postgres user=postgres password=... sslmode=require" > psql (16.3 (Debian 16.3-1.pgdg120+1), server 17.2 (Debian 17.2-1.pgdg120+1)) > WARNING: psql major version 16, server major version 17. > Some psql features might not work. > SSL connection (protocol: TLSv1.3, cipher: TLS_AES_128_GCM_SHA256, compression: off) > Type"help" for help. > > postgres=# \q > root@hetzner-2:~# docker run -it postgres:16.4 psql "host=headcrashing.eu port=5432 > dbname=postgres user=postgres password=... sslmode=require" > psql: error: connection to server at"headcrashing.eu" (49.13.53.107), port 5432 failed: SSL error: tlsv1 alert no application protocol There were no changes between 16.3 and 16.4 to explain this. When I test that with v16 client that I built from sources, I don't get that error. The error message suggests that you're actually using libpq v17. And indeed I get that error when connecting with v17 client. Perhaps the postgres:16.4 docker image was built with v17 libpq? -- Heikki Linnakangas Neon (https://neon.tech)