[pbs-devel] [PATCH proxmox-http] http: fix proxy authorization header to include type

Mira Limbeck m.limbeck at proxmox.com
Wed Jul 20 16:20:40 CEST 2022


and encode the username:password string as base64 [0]. This fixes the
error 407 issue when using proxy authentication [1].


[0] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization
[1] https://forum.proxmox.com/threads/checking-the-subscription-behind-a-proxy-fails.112063/

Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
 proxmox-http/src/client/connector.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxmox-http/src/client/connector.rs b/proxmox-http/src/client/connector.rs
index d6ba9dd..f3e7535 100644
--- a/proxmox-http/src/client/connector.rs
+++ b/proxmox-http/src/client/connector.rs
@@ -184,8 +184,8 @@ impl hyper::service::Service<Uri> for HttpsConnector {
                     if let Some(authorization) = authorization {
                         let _ = write!(
                             connect_request,
-                            "Proxy-Authorization: {}\r\n",
-                            authorization
+                            "Proxy-Authorization: Basic {}\r\n",
+                            base64::encode(authorization)
                         );
                     }
                     let _ = write!(connect_request, "Host: {0}:{1}\r\n\r\n", host, port);
-- 
2.30.2






More information about the pbs-devel mailing list