mirror of https://github.com/Icinga/icinga2.git
Ignore repeated requests from client after using ca remove command
This commit is contained in:
parent
a970f7dcf9
commit
429f1ed317
|
@ -61,7 +61,7 @@ int CARemoveCommand::Run(const boost::program_options::variables_map& vm, const
|
|||
<< "No request exists for fingerprint '" << ap[0] << "'.";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Utility::SaveJsonFile(ApiListener::GetCertificateRequestsDir() + "/" + ap[0] + ".removed", 700, Utility::LoadJsonFile(requestFile));
|
||||
if(remove(requestFile.CStr()) != 0)
|
||||
return 1;
|
||||
|
||||
|
|
|
@ -129,6 +129,12 @@ Value RequestCertificateHandler(const MessageOrigin::Ptr& origin, const Dictiona
|
|||
|
||||
return result;
|
||||
}
|
||||
} else if (Utility::PathExists(requestDir + "/" + certFingerprint + ".removed")) {
|
||||
Log(LogInformation, "JsonRpcConnection")
|
||||
<< "Certificate for CN " << cn << " has been removed. Ignoring signing request.";
|
||||
result->Set("status_code", 1);
|
||||
result->Set("error", "Ticket for CN " + cn + " declined by administrator.");
|
||||
return result;
|
||||
}
|
||||
|
||||
std::shared_ptr<X509> newcert;
|
||||
|
|
Loading…
Reference in New Issue