mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-05 21:04:28 +02:00
pki::RequestCertificate: handle missing certificate/CSR
This commit is contained in:
parent
b46c3c11bb
commit
4a7960f21b
@ -52,6 +52,15 @@ Value RequestCertificateHandler(const MessageOrigin::Ptr& origin, const Dictiona
|
||||
else
|
||||
cert = StringToCertificate(certText);
|
||||
|
||||
if (!cert) {
|
||||
Log(LogWarning, "JsonRpcConnection") << "No certificate or CSR received";
|
||||
|
||||
result->Set("status_code", 1);
|
||||
result->Set("error", "No certificate or CSR received.");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
ApiListener::Ptr listener = ApiListener::GetInstance();
|
||||
std::shared_ptr<X509> cacert = GetX509Certificate(listener->GetDefaultCaPath());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user