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 1rzAG0-002BhB-Fe for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Apr 2024 07:08:01 +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 1rzAFy-006wky-4J for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Apr 2024 07:07:58 +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 1rzAFw-006wkS-If for pgsql-hackers@lists.postgresql.org; Tue, 23 Apr 2024 07:07:57 +0000 Received: from wfout7-smtp.messagingengine.com ([64.147.123.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzAFo-002Tk0-M5 for pgsql-hackers@lists.postgresql.org; Tue, 23 Apr 2024 07:07:55 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id E588B1C00171; Tue, 23 Apr 2024 03:07:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 23 Apr 2024 03:07:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1713856064; x=1713942464; bh=zJm0CD6a+H wll1qzHAydx4TJWVJO3hXfJ7Uvsxte8aU=; b=M2Uy6LsgvQ3JOlEWXg7piyqNPi RxxtXBUqxh6UuLCw+W8C5ijRRwyCzjYBHtbqIjkNLqKpSgrdZ49RLGNpoi+Ov1B6 xjwhRcdC+KgEzsp+9oyULa7FDg6zAlFUA9cnlPqnBewj071hExBvKqyrHgOmLT7R FWHifz65OjNN5DVx6L/z/FcXLH/QzNWzXb4gprPLigoEIUsff9mBRTtui1TxViVV isxUjdplklzvGMHyX/TgMC8QfLBexMrY7U8r7n0rzNM7X4rLuASP+jkub3eLmutH OgdpntAh+87lrKsJ/pWvIO3StfgwywPIQIwrpDzJAONa/n5IwMUjC29TfwiA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1713856064; x=1713942464; bh=zJm0CD6a+Hwll1qzHAydx4TJWVJO 3hXfJ7Uvsxte8aU=; b=IxB6gHwsWyD8nbFr30LrTrA6OPVIbKIO6licRpX2OxWR QpcfEMPytZpCfCOK2Th/JjeQja9lONzFOLMyWdrCPTz2Nxep+3yB+trrfe684m2L S4J0ahw5+xqC0bff099I83XHsqs6KpCIvkxEGlBCfMRtPSjuALoRHHJYQd2o/7hh VQQuvbr6ozEMT6UjPn7ycbCoMiPr7PL9IUQnjqjh6Rsw6dxpxOsyxifVxQp8Ygtj H95lEN64px1E0J8onj+ZOCHHzW7nKkUmNp9rGW+UPwiWi2mraFpKi4vBznIqdPuG aF76CWNi1/U351ARtg8cjDf7R8+WR2BpzOorI0MDlQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeltddguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreer tddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlse hprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpefgheduuedvffeugfegjeef tdffjefgfeevheeiueetteegtdelieefjeeukeeikeenucffohhmrghinhephhhmmhdrih hsnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhi tghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 23 Apr 2024 03:07:42 -0400 (EDT) Date: Tue, 23 Apr 2024 16:07:32 +0900 From: Michael Paquier To: Heikki Linnakangas Cc: Jacob Champion , Postgres hackers Subject: Re: Direct SSL connection with ALPN and HBA rules Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xxsayu6cmz3xNbws" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --xxsayu6cmz3xNbws Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 23, 2024 at 01:48:04AM +0300, Heikki Linnakangas wrote: > Here's the patch for that. The error message is: >=20 > "direct SSL connection was established without ALPN protocol negotiation > extension" WFM. > That's accurate, but I wonder if we could make it more useful to a user > who's wondering what went wrong. I'd imagine that if the server doesn't > support ALPN, it's because you have some kind of a (not necessarily > malicious) generic SSL man-in-the-middle that doesn't support it. Or you'= re > trying to connect to an HTTPS server. Suggestions welcome. Hmm. Is there any point in calling SSL_get0_alpn_selected() in open_client_SSL() to get the ALPN if current_enc_method is not ENC_DIRECT_SSL? In the documentation of PQsslAttribute(), it is mentioned that empty string is returned for "alpn" if ALPN was not used, however the code returns NULL in this case: SSL_get0_alpn_selected(conn->ssl, &data, &len); if (data =3D=3D NULL || len =3D=3D 0 || len > sizeof(alpn_str) - 1) return NULL; -- Michael --xxsayu6cmz3xNbws Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmYnXjQACgkQnvQgOdby QH2BOQ//fAhrLiY0vxTIvj7/JN1Uazo0z3sIdS62ydcj9L/HlhaBPBpgVmdlzFqs AXU2MN0oZR5yBIA481cxEO+wSa1Nku6wSNtcK/r0tEsBCxtYLQZvVfBJgnY6c0jG 2ZxVTyE03Gthf0tRtt9V7hJnYEOpPXekWiWLZ0cSa9hixyoi6UEb7ayD4qmAl5+W vbQmOAj5LmCPNkAo0zhJTq+OiBBcK2PXBwYf7+qdIasqWIY8SbcymnUZ6w1pwv4O w99UoTlRfFonypYNS1xZaXDx4MZSdCKF6d2z6kPt63u3Viwrs2a6QUfrW/sgkSnE mZOBswn82AGb40Jm6BsG1M8Qv4+PTwzcVyg892s5z/gSbcKlJDYisMydbQe9EbBu 1upsqLviXKxwVYYLFifx3SR/Ne8wxZkPa/41EwL08YdBUYJOXZ3+hMrwKFkcEKa/ JjTym1x4NdyYoSdlO3FgTj6eeAmtTd1k7ujfTmteKpBtqbya3G48H1OydT0JfMcN rQy//hicSbiE/1ApMa9KG4v5C+EHGj9tghVQ3sT8505mWd3htjaok1+yq3/1nElB znp2KSEzAoyuKpZk20LcXtFnOwVy5wQZBBP5joqNou33ewkrCHVBa43wn4s4yy63 5mwZ2X0CIKvYvE0cRQAnNd8g+vAVUAHcivRJTc6Z4/umVhKYX8s= =6/EN -----END PGP SIGNATURE----- --xxsayu6cmz3xNbws--