public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Friedrich Weber <f.weber@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 2/2] fix #3716: api: nodes: query metadata: use proxy option for https
Date: Wed, 26 Mar 2025 11:51:08 +0100	[thread overview]
Message-ID: <20250326105108.34911-3-f.weber@proxmox.com> (raw)
In-Reply-To: <20250326105108.34911-1-f.weber@proxmox.com>

When downloading an ISO, VZ template, or OVA file via the web UI, the
web UI uses the query-url-metadata endpoint to query file size, file
name and MIME type via an HTTP HEAD request. In a setup where this
request has to go over a proxy (configured via the http_proxy
datacenter option), querying the metadata only works for http:// URLs,
not https:// URLs. The reason is that the query-url-metadata handler
uses LWP and does not register the proxy for the https scheme.

Fix this by registering the proxy also for the https scheme.

This will break setups that rely on http_proxy not being respected for
https:// URLs. For example, setups that have a proxy for external
connections, but download e.g. ISO files (only) via https from an
internal repository that the proxy doesn't serve.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
---
 PVE/API2/Nodes.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 9cdf19db..c142607e 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -1760,7 +1760,7 @@ __PACKAGE__->register_method({
 
 	my $dccfg = PVE::Cluster::cfs_read_file('datacenter.cfg');
 	if ($dccfg->{http_proxy}) {
-	    $ua->proxy('http', $dccfg->{http_proxy});
+	    $ua->proxy(['http', 'https'], $dccfg->{http_proxy});
 	}
 
 	my $verify = $param->{'verify-certificates'} // 1;
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-03-26 10:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26 10:51 [pve-devel] [PATCH manager/storage 0/2] fix #3716: allow downloading iso/vztmpl/ova via https in proxied environments Friedrich Weber
2025-03-26 10:51 ` [pve-devel] [PATCH storage 1/2] fix #3716: api: download from url: use proxy option for https Friedrich Weber
2025-03-26 10:51 ` Friedrich Weber [this message]
2025-03-26 11:04 ` [pve-devel] [PATCH manager/storage 0/2] fix #3716: allow downloading iso/vztmpl/ova via https in proxied environments Friedrich Weber
2025-03-26 15:07 ` Maximiliano Sandoval
2025-04-05 16:28 ` [pve-devel] applied-series: " Thomas Lamprecht

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=20250326105108.34911-3-f.weber@proxmox.com \
    --to=f.weber@proxmox.com \
    --cc=pve-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 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