mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Merge pull request #6880 from Icinga/bugfix/pki-requestcertificate-no-cert
pki::RequestCertificate: handle missing certificate/CSR
This commit is contained in:
commit
e1a941e5c7
@ -52,6 +52,15 @@ Value RequestCertificateHandler(const MessageOrigin::Ptr& origin, const Dictiona
|
|||||||
else
|
else
|
||||||
cert = StringToCertificate(certText);
|
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();
|
ApiListener::Ptr listener = ApiListener::GetInstance();
|
||||||
std::shared_ptr<X509> cacert = GetX509Certificate(listener->GetDefaultCaPath());
|
std::shared_ptr<X509> cacert = GetX509Certificate(listener->GetDefaultCaPath());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user