- die "No plugin data for DNSChallenge\n" if !defined($data->{plugin});
- my $domain = $data->{plugin}->{alias} ? $data->{plugin}->{alias} : $data->{domain};
- my $txtvalue = PVE::ACME::encode(sha256($data->{key_authorization}));
- my $dnsplugin = $data->{plugin}->{api};
- my $plugin_conf_string = $data->{plugin}->{data};
-
- # for security reasons, we execute the command as nobody
- # we can't verify that the code of the DNSPlugins are harmless.
- my $cmd = ["setpriv", "--reuid", "nobody", "--regid", "nogroup", "--clear-groups", "--"];
- push @$cmd, "/bin/bash", "$ACME_PATH", "teardown", $dnsplugin, $domain ;
- push @$cmd, $txtvalue, $plugin_conf_string;
- PVE::Tools::run_command($cmd, outfunc => $outfunc);
+ my $domain = $proxmox_acme_command->($self, $acme, $auth, $data, 'teardown');