mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 20:24:33 +02:00
Merge pull request #9404 from Icinga/feature/icingadb-no-ca-error-message
Icinga DB: make error message more helpful if API isn't set up
This commit is contained in:
commit
dc571e4d0a
@ -292,7 +292,14 @@ void IcingaDB::InitEnvironmentId()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::shared_ptr<X509> cert = GetX509Certificate(ApiListener::GetDefaultCaPath());
|
String caPath = ApiListener::GetDefaultCaPath();
|
||||||
|
|
||||||
|
if (!Utility::PathExists(caPath)) {
|
||||||
|
throw std::runtime_error("Cannot find the CA certificate at '" + caPath + "'. "
|
||||||
|
"Please ensure the ApiListener is enabled first using 'icinga2 api setup'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<X509> cert = GetX509Certificate(caPath);
|
||||||
|
|
||||||
unsigned int n;
|
unsigned int n;
|
||||||
unsigned char digest[EVP_MAX_MD_SIZE];
|
unsigned char digest[EVP_MAX_MD_SIZE];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user