all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-http] http: fix proxy authorization header to include type
Date: Wed, 20 Jul 2022 16:20:40 +0200	[thread overview]
Message-ID: <20220720142040.2140178-1-m.limbeck@proxmox.com> (raw)

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@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





             reply	other threads:[~2022-07-20 14:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-20 14:20 Mira Limbeck [this message]
2022-07-21 10:56 ` [pbs-devel] applied: " Wolfgang Bumiller
2022-07-21 11:32 ` [pbs-devel] " Thomas Lamprecht
2022-07-21 11:46   ` Wolfgang Bumiller
2022-07-22  9:50     ` Mira Limbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220720142040.2140178-1-m.limbeck@proxmox.com \
    --to=m.limbeck@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal