JsonRpcConnection::SendCertificateRequest(JsonRpcConnection::Ptr(), origin, requestPath);
result->Set("status_code", 2);
- result->Set("error", "Certificate request is pending. Waiting for approval from the parent Icinga instance.");
+ result->Set("error", "Certificate request for CN '" + cn + "' is pending. Waiting for approval from the parent Icinga instance.");
Log(LogInformation, "JsonRpcConnection")
- << "Certificate request is pending. Waiting for approval.";
+ << "Certificate request for CN '" << cn << "' is pending. Waiting for approval.";
return result;
}
/* Path is empty if this is our own request. */
if (path.IsEmpty()) {
- String ticketPath = Application::GetLocalStateDir() + "/lib/icinga2/pki/ticket";
+ String ticketPath = ApiListener::GetCertsDir() + "/ticket";
std::ifstream fp(ticketPath.CStr());
String ticket((std::istreambuf_iterator<char>(fp)), std::istreambuf_iterator<char>());
return Empty;
}
- Log(LogWarning, "JsonRpcConnection")
- << params->ToString();
-
String ca = params->Get("ca");
String cert = params->Get("cert");
String requestDir = ApiListener::GetCertificateRequestsDir();
String requestPath = requestDir + "/" + certFingerprint + ".json";
- std::cout << requestPath << "\n";
-
/* Save the received signed certificate request to disk. */
if (Utility::PathExists(requestPath)) {
Log(LogInformation, "JsonRpcConnection")
}
/* Update the certificates at runtime and reconnect all endpoints. */
- Log(LogInformation, "JsonRpcConnection", "Updating the client certificate at runtime and reconnecting the endpoints.");
+ Log(LogInformation, "JsonRpcConnection")
+ << "Updating the client certificate for CN '" << cn << "' at runtime and reconnecting the endpoints.";
listener->UpdateSSLContext();
return Empty;