mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 15:44:11 +02:00
CLI: Catch exception when trusted cert is not readable
This catches an exception when the trusted cert is not readable during node setup.
This commit is contained in:
parent
e9b8fc234b
commit
18cf314480
@ -373,7 +373,15 @@ int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
trustedParentCert = GetX509Certificate(vm["trustedcert"].as<std::string>());
|
String trustedCert = vm["trustedcert"].as<std::string>();
|
||||||
|
|
||||||
|
try{
|
||||||
|
trustedParentCert = GetX509Certificate(trustedCert)
|
||||||
|
} catch (const std::exception&) {
|
||||||
|
Log(LogCritical, "cli")
|
||||||
|
<< "Can't read trusted cert at '" << trustedCert << "'.";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
Log(LogInformation, "cli")
|
Log(LogInformation, "cli")
|
||||||
<< "Verifying trusted certificate file '" << vm["trustedcert"].as<std::string>() << "'.";
|
<< "Verifying trusted certificate file '" << vm["trustedcert"].as<std::string>() << "'.";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user