Abort verified JSON-RPC connections with no valid endpoint

This commit is contained in:
Johannes Schmidt 2025-04-22 09:18:05 +02:00
parent 520aed6049
commit 353386f404

View File

@ -834,6 +834,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