public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-http] http: fix proxy authorization header to include type
@ 2022-07-20 14:20 Mira Limbeck
  2022-07-21 10:56 ` [pbs-devel] applied: " Wolfgang Bumiller
  2022-07-21 11:32 ` [pbs-devel] " Thomas Lamprecht
  0 siblings, 2 replies; 5+ messages in thread
From: Mira Limbeck @ 2022-07-20 14:20 UTC (permalink / raw)
  To: pbs-devel

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-http] http: fix proxy authorization header to include type
  2022-07-20 14:20 [pbs-devel] [PATCH proxmox-http] http: fix proxy authorization header to include type Mira Limbeck
@ 2022-07-21 10:56 ` Wolfgang Bumiller
  2022-07-21 11:32 ` [pbs-devel] " Thomas Lamprecht
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Bumiller @ 2022-07-21 10:56 UTC (permalink / raw)
  To: Mira Limbeck; +Cc: pbs-devel

applied, thanks




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-http] http: fix proxy authorization header to include type
  2022-07-20 14:20 [pbs-devel] [PATCH proxmox-http] http: fix proxy authorization header to include type Mira Limbeck
  2022-07-21 10:56 ` [pbs-devel] applied: " Wolfgang Bumiller
@ 2022-07-21 11:32 ` Thomas Lamprecht
  2022-07-21 11:46   ` Wolfgang Bumiller
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Lamprecht @ 2022-07-21 11:32 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Mira Limbeck
  Cc: Wolfgang Bumiller

Am 20/07/2022 um 16:20 schrieb Mira Limbeck:
> and encode the username:password string as base64 [0]. This fixes the
> error 407 issue when using proxy authentication [1].

does this break setups that configured "Basic base64-encoded-pw" themselves though,
or was that never possible (e.g., due to schema not allowing that)?




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-http] http: fix proxy authorization header to include type
  2022-07-21 11:32 ` [pbs-devel] " Thomas Lamprecht
@ 2022-07-21 11:46   ` Wolfgang Bumiller
  2022-07-22  9:50     ` Mira Limbeck
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Bumiller @ 2022-07-21 11:46 UTC (permalink / raw)
  To: Thomas Lamprecht
  Cc: Proxmox Backup Server development discussion, Mira Limbeck

On Thu, Jul 21, 2022 at 01:32:32PM +0200, Thomas Lamprecht wrote:
> Am 20/07/2022 um 16:20 schrieb Mira Limbeck:
> > and encode the username:password string as base64 [0]. This fixes the
> > error 407 issue when using proxy authentication [1].
> 
> does this break setups that configured "Basic base64-encoded-pw" themselves though,
> or was that never possible (e.g., due to schema not allowing that)?

That would break other things. Eg. `ProxyConfig;:to_proxy_string` uses
it to build "http://<authorization>@<host>" strings, so the "Basic "
prefix and base64 encoding would break those.

However, we also build such headers in src/client/simple.rs which should
will need the same change I suppose?




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-http] http: fix proxy authorization header to include type
  2022-07-21 11:46   ` Wolfgang Bumiller
@ 2022-07-22  9:50     ` Mira Limbeck
  0 siblings, 0 replies; 5+ messages in thread
From: Mira Limbeck @ 2022-07-22  9:50 UTC (permalink / raw)
  To: Wolfgang Bumiller, Thomas Lamprecht
  Cc: Proxmox Backup Server development discussion

On 7/21/22 13:46, Wolfgang Bumiller wrote:
> On Thu, Jul 21, 2022 at 01:32:32PM +0200, Thomas Lamprecht wrote:
>> Am 20/07/2022 um 16:20 schrieb Mira Limbeck:
>>> and encode the username:password string as base64 [0]. This fixes the
>>> error 407 issue when using proxy authentication [1].
>> does this break setups that configured "Basic base64-encoded-pw" themselves though,
>> or was that never possible (e.g., due to schema not allowing that)?
> That would break other things. Eg. `ProxyConfig;:to_proxy_string` uses
> it to build "http://<authorization>@<host>" strings, so the "Basic "
> prefix and base64 encoding would break those.
>
> However, we also build such headers in src/client/simple.rs which should
> will need the same change I suppose?

Do we want to make the authentication scheme, here `Basic`, configurable?





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-22  9:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20 14:20 [pbs-devel] [PATCH proxmox-http] http: fix proxy authorization header to include type Mira Limbeck
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal