From: Gunnar Beutner Date: Wed, 30 Aug 2017 13:02:48 +0000 (+0200) Subject: Disconnect all clients when we update our own certificate X-Git-Tag: v2.8.0~87^2~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4cfbf6eb17192d41085e502442edfb65388cc053;p=icinga2 Disconnect all clients when we update our own certificate refs #5450 --- diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index ad63b3a17..d298bbe1e 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -122,6 +122,16 @@ void ApiListener::UpdateSSLContext(void) } m_SSLContext = context; + + for (const Endpoint::Ptr& endpoint : ConfigType::GetObjectsByType()) { + for (const JsonRpcConnection::Ptr& client : endpoint->GetClients()) { + client->Disconnect(); + } + } + + for (const JsonRpcConnection::Ptr& client : m_AnonymousClients) { + client->Disconnect(); + } } void ApiListener::OnAllConfigLoaded(void)