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 1rtePG-00GUdY-Cd for pgsql-committers@arkaria.postgresql.org; Mon, 08 Apr 2024 02:06:47 +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 1rtePF-00Fv8E-Hs for pgsql-committers@arkaria.postgresql.org; Mon, 08 Apr 2024 02:06:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rtePF-00Fv6L-7g for pgsql-committers@lists.postgresql.org; Mon, 08 Apr 2024 02:06:45 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rtePC-001UVE-BS for pgsql-committers@lists.postgresql.org; Mon, 08 Apr 2024 02:06:44 +0000 Received: from [192.168.1.115] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (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 meesny.iki.fi (Postfix) with ESMTPSA id 4VCXWz3GMdzyTn; Mon, 8 Apr 2024 05:06:39 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1712542000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VFn7j2sV4KlbAdRdUjEpGTEIgUqnnbTi5RU1qa2sXbU=; b=SEWgsWhDyoV+ov3w1xqT3sX8V+0MeOSkXpwVgXgrf9XMLGVIet0Z6oj6UMmF9qW0dTailk 7C7yF5xHov+FQWIEsSHGvgg581t7Akk+50dtpOtdP/6s1YvvOJ6Onmq+KjG5qH9ghKUfvi hTwpjWrBEAc/jCp0Z4tfeDWM398p7Fg= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1712542000; a=rsa-sha256; cv=none; b=LatbB1DArB73+mym8lMr3GoxqDIMqNecu73G+Sd6iI4e6dOXpwOxhx5uqy5WEkIDcCxsP/ uxQum7DZxtykpc1Au4G/xAm0KMLBYmhYiadFmdfksz9VCHP2RBTdOFUO3Y9S7gDSKXfAvd NYGNpTC8bDXC+bJN7m0Lm3HE6Bi5PgY= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1712542000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VFn7j2sV4KlbAdRdUjEpGTEIgUqnnbTi5RU1qa2sXbU=; b=dBOW41ORNMdsln7zKv65PcuU1DDssL+FwrCXFZrsP6hB3lTZV5oK2a8ngfMr9slb5ZAdlz mbB9sbzMW2DnhQeNaaP7v6TRbeZJcxbGoidZBsHOQnOvYggW9c9Wa3490bQJTfpjMfF/Sf SCaxbonmhfKBtzg7YE2PbKf8sBbd5tw= Message-ID: <0f022354-c9cc-47c2-ace3-89d2101895f4@iki.fi> Date: Mon, 8 Apr 2024 05:06:38 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Send ALPN in TLS handshake, require it in direct SSL connections Content-Language: en-US To: Andres Freund , Heikki Linnakangas Cc: pgsql-committers@lists.postgresql.org References: <20240408015055.xsuahullywpfwyvu@awork3.anarazel.de> From: Heikki Linnakangas In-Reply-To: <20240408015055.xsuahullywpfwyvu@awork3.anarazel.de> 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 08/04/2024 04:50, Andres Freund wrote: > On 2024-04-08 01:25:40 +0000, Heikki Linnakangas wrote: >> Send ALPN in TLS handshake, require it in direct SSL connections >> >> libpq now always tries to send ALPN. With the traditional negotiated >> SSL connections, the server accepts the ALPN, and refuses the >> connection if it's not what we expect, but connecting without ALPN is >> still OK. With the new direct SSL connections, ALPN is mandatory. >> >> NOTE: This uses "TBD-pgsql" as the protocol ID. We must register a >> proper one with IANA before the release! >> >> Author: Greg Stark, Heikki Linnakangas >> Reviewed-by: Matthias van de Meent, Jacob Champion > > My compiler complains: > > [396/992 42 39%] Compiling C object src/backend/postgres_lib.a.p/libpq_be-secure-openssl.c.o > ../../../../../home/andres/src/postgresql/src/backend/libpq/be-secure-openssl.c: In function 'alpn_cb': > ../../../../../home/andres/src/postgresql/src/backend/libpq/be-secure-openssl.c:1327:69: warning: ordered comparison of pointer with integer zero [-Wextra] > 1327 | if (*out == NULL || *outlen > sizeof(alpn_protos) || outlen <= 0) > | ^~ > [991/992 1 99%] Linking target src/bin/pg_dump/pg_dump > > And I think it may show why the warning is a good idea - I assume > "*outlen <= 0" was intended? Yes. Fixed, thanks! -- Heikki Linnakangas Neon (https://neon.tech)