From 9be9d4b6ab8709d9a8245fe830783473f184869e Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 28 Mar 2024 11:19:56 +0100 Subject: [PATCH] http: support ALPN negotiated http2 Signed-off-by: Wolfgang Bumiller --- proxmox-http/src/client/tls.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/proxmox-http/src/client/tls.rs b/proxmox-http/src/client/tls.rs index 830d52ee..f785108a 100644 --- a/proxmox-http/src/client/tls.rs +++ b/proxmox-http/src/client/tls.rs @@ -87,7 +87,14 @@ impl Connection for MaybeTlsStre match self { MaybeTlsStream::Normal(s) => s.connected(), MaybeTlsStream::Proxied(s) => s.connected().proxy(true), - MaybeTlsStream::Secured(s) => s.get_ref().connected(), + MaybeTlsStream::Secured(s) => { + let connected = s.get_ref().connected(); + if s.ssl().selected_alpn_protocol() == Some(b"h2") { + connected.negotiated_h2() + } else { + connected + } + } } } }