]> git.proxmox.com Git - proxmox.git/commitdiff
http: support ALPN negotiated http2
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 28 Mar 2024 10:19:56 +0000 (11:19 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 28 Mar 2024 10:19:56 +0000 (11:19 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-http/src/client/tls.rs

index 830d52eebc373f1c00b2207c8d72867eabbd4311..f785108a44a79756d07e8804f22ce4db48b1162a 100644 (file)
@@ -87,7 +87,14 @@ impl<S: Connection + AsyncRead + AsyncWrite + Unpin> 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
+                }
+            }
         }
     }
 }