]> granicus.if.org Git - icinga2/commitdiff
Disconnect all clients when we update our own certificate
authorGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 30 Aug 2017 13:02:48 +0000 (15:02 +0200)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Tue, 12 Sep 2017 10:52:49 +0000 (12:52 +0200)
refs #5450

lib/remote/apilistener.cpp

index ad63b3a17c0307b0cec49ac8e4c4a8fdd587e4d1..d298bbe1e903c6c7609998a6eb1d398446ec03ad 100644 (file)
@@ -122,6 +122,16 @@ void ApiListener::UpdateSSLContext(void)
        }
 
        m_SSLContext = context;
+
+       for (const Endpoint::Ptr& endpoint : ConfigType::GetObjectsByType<Endpoint>()) {
+               for (const JsonRpcConnection::Ptr& client : endpoint->GetClients()) {
+                       client->Disconnect();
+               }
+       }
+
+       for (const JsonRpcConnection::Ptr& client : m_AnonymousClients) {
+               client->Disconnect();
+       }
 }
 
 void ApiListener::OnAllConfigLoaded(void)