mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 07:04:37 +02:00
Don't require tickets for clients which already have a trusted certificate
fixes #8465
This commit is contained in:
parent
377f66c403
commit
33e747ae2e
@ -220,11 +220,12 @@ Value RequestCertificateHandler(const MessageOrigin& origin, const Dictionary::P
|
|||||||
if (!params)
|
if (!params)
|
||||||
return Empty;
|
return Empty;
|
||||||
|
|
||||||
|
Dictionary::Ptr result = new Dictionary();
|
||||||
|
|
||||||
|
if (!origin.FromClient->IsAuthenticated()) {
|
||||||
ApiListener::Ptr listener = ApiListener::GetInstance();
|
ApiListener::Ptr listener = ApiListener::GetInstance();
|
||||||
String salt = listener->GetTicketSalt();
|
String salt = listener->GetTicketSalt();
|
||||||
|
|
||||||
Dictionary::Ptr result = new Dictionary();
|
|
||||||
|
|
||||||
if (salt.IsEmpty()) {
|
if (salt.IsEmpty()) {
|
||||||
result->Set("error", "Ticket salt is not configured.");
|
result->Set("error", "Ticket salt is not configured.");
|
||||||
return result;
|
return result;
|
||||||
@ -237,6 +238,7 @@ Value RequestCertificateHandler(const MessageOrigin& origin, const Dictionary::P
|
|||||||
result->Set("error", "Invalid ticket.");
|
result->Set("error", "Invalid ticket.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boost::shared_ptr<X509> cert = origin.FromClient->GetStream()->GetPeerCertificate();
|
boost::shared_ptr<X509> cert = origin.FromClient->GetStream()->GetPeerCertificate();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user