mirror of https://github.com/Icinga/icinga2.git
parent
fa1d633484
commit
19134f41cf
|
@ -321,16 +321,24 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hostname.IsEmpty() && identity != hostname) {
|
verify_ok = tlsStream->IsVerifyOK();
|
||||||
Log(LogInformation, "ApiListener")
|
if (!hostname.IsEmpty()) {
|
||||||
<< "Unexpected certificate common name while connecting to endpoint '" << hostname << "': got '" << identity << "'";
|
if (identity != hostname) {
|
||||||
return;
|
Log(LogWarning, "ApiListener")
|
||||||
|
<< "Unexpected certificate common name while connecting to endpoint '"
|
||||||
|
<< hostname << "': got '" << identity << "'";
|
||||||
|
return;
|
||||||
|
} else if (!verify_ok) {
|
||||||
|
Log(LogWarning, "ApiListener")
|
||||||
|
<< "Peer certificate for endpoint '" << hostname
|
||||||
|
<< "' is not signed by the certificate authority.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
verify_ok = tlsStream->IsVerifyOK();
|
|
||||||
|
|
||||||
Log(LogInformation, "ApiListener")
|
Log(LogInformation, "ApiListener")
|
||||||
<< "New client connection for identity '" << identity << "'" << (verify_ok ? "" : " (unauthenticated)");
|
<< "New client connection for identity '" << identity << "'"
|
||||||
|
<< (verify_ok ? "" : " (client certificate not signed by CA)");
|
||||||
|
|
||||||
if (verify_ok)
|
if (verify_ok)
|
||||||
endpoint = Endpoint::GetByName(identity);
|
endpoint = Endpoint::GetByName(identity);
|
||||||
|
|
Loading…
Reference in New Issue