mirror of https://github.com/Icinga/icinga2.git
parent
87e63edb93
commit
de229f9fec
|
@ -47,14 +47,14 @@ void ApiListener::OnConfigLoaded(void)
|
||||||
cert = GetX509Certificate(GetCertPath());
|
cert = GetX509Certificate(GetCertPath());
|
||||||
} catch (std::exception&) {
|
} catch (std::exception&) {
|
||||||
Log(LogCritical, "ApiListener", "Cannot get certificate from cert path: '" + GetCertPath() + "'.");
|
Log(LogCritical, "ApiListener", "Cannot get certificate from cert path: '" + GetCertPath() + "'.");
|
||||||
return;
|
Application::Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SetIdentity(GetCertificateCN(cert));
|
SetIdentity(GetCertificateCN(cert));
|
||||||
} catch (std::exception&) {
|
} catch (std::exception&) {
|
||||||
Log(LogCritical, "ApiListener", "Cannot get certificate common name from cert path: '" + GetCertPath() + "'.");
|
Log(LogCritical, "ApiListener", "Cannot get certificate common name from cert path: '" + GetCertPath() + "'.");
|
||||||
return;
|
Application::Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(LogInformation, "ApiListener", "My API identity: " + GetIdentity());
|
Log(LogInformation, "ApiListener", "My API identity: " + GetIdentity());
|
||||||
|
@ -63,7 +63,7 @@ void ApiListener::OnConfigLoaded(void)
|
||||||
m_SSLContext = MakeSSLContext(GetCertPath(), GetKeyPath(), GetCaPath());
|
m_SSLContext = MakeSSLContext(GetCertPath(), GetKeyPath(), GetCaPath());
|
||||||
} catch (std::exception&) {
|
} catch (std::exception&) {
|
||||||
Log(LogCritical, "ApiListener", "Cannot make SSL context for cert path: '" + GetCertPath() + "' key path: '" + GetKeyPath() + "' ca path: '" + GetCaPath() + "'.");
|
Log(LogCritical, "ApiListener", "Cannot make SSL context for cert path: '" + GetCertPath() + "' key path: '" + GetKeyPath() + "' ca path: '" + GetCaPath() + "'.");
|
||||||
return;
|
Application::Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetCrlPath().IsEmpty()) {
|
if (!GetCrlPath().IsEmpty()) {
|
||||||
|
@ -71,13 +71,13 @@ void ApiListener::OnConfigLoaded(void)
|
||||||
AddCRLToSSLContext(m_SSLContext, GetCrlPath());
|
AddCRLToSSLContext(m_SSLContext, GetCrlPath());
|
||||||
} catch (std::exception&) {
|
} catch (std::exception&) {
|
||||||
Log(LogCritical, "ApiListener", "Cannot add certificate revocation list to SSL context for crl path: '" + GetCrlPath() + "'.");
|
Log(LogCritical, "ApiListener", "Cannot add certificate revocation list to SSL context for crl path: '" + GetCrlPath() + "'.");
|
||||||
return;
|
Application::Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Endpoint::GetByName(GetIdentity())) {
|
if (!Endpoint::GetByName(GetIdentity())) {
|
||||||
Log(LogCritical, "ApiListener", "Endpoint object for '" + GetIdentity() + "' is missing.");
|
Log(LogCritical, "ApiListener", "Endpoint object for '" + GetIdentity() + "' is missing.");
|
||||||
return;
|
Application::Exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
SyncZoneDirs();
|
SyncZoneDirs();
|
||||||
|
|
Loading…
Reference in New Issue