]> git.proxmox.com Git - proxmox-acme.git/blobdiff - src/PVE/ACME/DNSChallenge.pm
dns-challenge: add 'use-proxy' property
[proxmox-acme.git] / src / PVE / ACME / DNSChallenge.pm
index 7214d8889ecadee1c8b9b1a0c58e2ed127d5e679..3e86f8c86160d981c09eddbdd1db7ca3449d27bd 100644 (file)
@@ -56,7 +56,12 @@ sub properties {
            optional => 1,
            minimum => 0,
            maximum => 2 * 24 * 60 * 60,
-       }
+       },
+       'use-proxy' => {
+           description => "Flag indicating whether a http proxy should be used.",
+           type => 'boolean',
+           optional => 1,
+       },
     };
 }
 
@@ -67,6 +72,7 @@ sub options {
        nodes => { optional => 1 },
        disable => { optional => 1 },
        'validation-delay' => { optional => 1 },
+       'use-proxy' => { optional => 1 },
     };
 }
 
@@ -84,6 +90,7 @@ my $proxmox_acme_command = sub {
     my $txtvalue = PVE::ACME::encode(sha256($key_auth));
     my $dnsplugin = $data->{plugin}->{api};
     my $plugin_conf_string = $data->{plugin}->{data};
+    my $proxy = $data->{plugin}->{proxy};
 
     # for security reasons, we execute the command as nobody
     # we can't verify that the code of the DNSPlugins are harmless.
@@ -99,6 +106,7 @@ my $proxmox_acme_command = sub {
     }
     my $input = "$txtvalue\n";
     $input .= "$plugin_conf_string\n" if $plugin_conf_string;
+    $input .= "https_proxy=$proxy\nhttp_proxy=$proxy\n" if $proxy;
 
     PVE::Tools::run_command($cmd, input => $input);