Merge pull request #10415 from Icinga/abort-no-endpoint-conns

Abort connections with no valid endpoint
This commit is contained in:
Yonas Habteab 2025-06-02 16:21:46 +02:00 committed by GitHub
commit 3d04eb456a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -835,6 +835,12 @@ void ApiListener::NewClientHandlerInternal(
if (ctype == ClientJsonRpc) {
Log(LogNotice, "ApiListener", "New JSON-RPC client");
if (verify_ok && !endpoint) {
Log(LogWarning, "ApiListener")
<< "Unknown endpoint '" << identity << "' with valid certificate. Aborting JSON-RPC connection.";
return;
}
if (endpoint && endpoint->GetConnected()) {
Log(LogInformation, "ApiListener")
<< "Ignoring JSON-RPC connection " << conninfo