mirror of https://github.com/Icinga/icinga2.git
Fix ApiListener const SSL context
This makes the SSL context in ApiListener::SpawnCoroutine non-const to address an issue when an agent recieves an signed certificate from the master and tries to update the SSL context. This also uses the class member variable which is captured by `this` in the lamda expression. fixes #7650
This commit is contained in:
parent
287e4c3a8d
commit
016a6c3f25
|
@ -416,14 +416,14 @@ bool ApiListener::AddListener(const String& node, const String& service)
|
|||
Log(LogInformation, "ApiListener")
|
||||
<< "Started new listener on '[" << localEndpoint.address() << "]:" << localEndpoint.port() << "'";
|
||||
|
||||
IoEngine::SpawnCoroutine(io, [this, acceptor, sslContext](asio::yield_context yc) { ListenerCoroutineProc(yc, acceptor, sslContext); });
|
||||
IoEngine::SpawnCoroutine(io, [this, acceptor](asio::yield_context yc) { ListenerCoroutineProc(yc, acceptor, m_SSLContext); });
|
||||
|
||||
UpdateStatusFile(localEndpoint);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ApiListener::ListenerCoroutineProc(boost::asio::yield_context yc, const Shared<boost::asio::ip::tcp::acceptor>::Ptr& server, const Shared<boost::asio::ssl::context>::Ptr& sslContext)
|
||||
void ApiListener::ListenerCoroutineProc(boost::asio::yield_context yc, const Shared<boost::asio::ip::tcp::acceptor>::Ptr& server, Shared<boost::asio::ssl::context>::Ptr& sslContext)
|
||||
{
|
||||
namespace asio = boost::asio;
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ private:
|
|||
|
||||
void NewClientHandler(boost::asio::yield_context yc, const Shared<AsioTlsStream>::Ptr& client, const String& hostname, ConnectionRole role);
|
||||
void NewClientHandlerInternal(boost::asio::yield_context yc, const Shared<AsioTlsStream>::Ptr& client, const String& hostname, ConnectionRole role);
|
||||
void ListenerCoroutineProc(boost::asio::yield_context yc, const Shared<boost::asio::ip::tcp::acceptor>::Ptr& server, const Shared<boost::asio::ssl::context>::Ptr& sslContext);
|
||||
void ListenerCoroutineProc(boost::asio::yield_context yc, const Shared<boost::asio::ip::tcp::acceptor>::Ptr& server, Shared<boost::asio::ssl::context>::Ptr& sslContext);
|
||||
|
||||
WorkQueue m_RelayQueue;
|
||||
WorkQueue m_SyncQueue{0, 4};
|
||||
|
|
Loading…
Reference in New Issue