From a8a838754d027a988caf1b348ffc9a55cc73ca87 Mon Sep 17 00:00:00 2001 From: Mira Limbeck Date: Wed, 20 Jul 2022 16:20:40 +0200 Subject: [PATCH] http: fix proxy authorization header to include type 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 --- 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 d6ba9dd2..f3e7535a 100644 --- a/proxmox-http/src/client/connector.rs +++ b/proxmox-http/src/client/connector.rs @@ -184,8 +184,8 @@ impl hyper::service::Service 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);