Signed-off-by: Maximiliano Sandoval <[email protected]>
---
 PVE/API2/APT.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/APT.pm b/PVE/API2/APT.pm
index 1ccbaf97..521cee9d 100644
--- a/PVE/API2/APT.pm
+++ b/PVE/API2/APT.pm
@@ -336,8 +336,11 @@ __PACKAGE__->register_method({
             # setup proxy for apt
 
             my $aptconf = "// no proxy configured\n";
-            if ($dcconf->{http_proxy}) {
-                $aptconf = "Acquire::http::Proxy \"$dcconf->{http_proxy}\";\n";
+            if (my $http_proxy = PVE::Cluster::get_proxy($dcconf, 'http', 
'apt')) {
+                $aptconf = "Acquire::http::Proxy \"$http_proxy\";\n";
+            }
+            if (my $https_proxy = PVE::Cluster::get_proxy($dcconf, 'https', 
'apt')) {
+                $aptconf .= "Acquire::https::Proxy \"$https_proxy\";\n";
             }
             my $aptcfn = "/etc/apt/apt.conf.d/76pveproxy";
             PVE::Tools::file_set_contents($aptcfn, $aptconf);
-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to