X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=lib%2Fremote%2Fapilistener.cpp;h=d680cc76a34a8ee13d7be9161c0cf9a59f2c8343;hb=2615967e7f461b502c2394d1f80ff3be0948bc5b;hp=d8e1832eed3fd5a0751801039cda74e23e5fc9a7;hpb=e4f3422b3a69dd0181de531740c7f008d34dd7cb;p=icinga2 diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index d8e1832ee..d680cc76a 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -165,10 +166,12 @@ void ApiListener::OnConfigLoaded() void ApiListener::UpdateSSLContext() { - std::shared_ptr context; + namespace ssl = boost::asio::ssl; + + std::shared_ptr context; try { - context = MakeSSLContext(GetDefaultCertPath(), GetDefaultKeyPath(), GetDefaultCaPath()); + context = MakeAsioSslContext(GetDefaultCertPath(), GetDefaultKeyPath(), GetDefaultCaPath()); } catch (const std::exception&) { BOOST_THROW_EXCEPTION(ScriptError("Cannot make SSL context for cert path: '" + GetDefaultCertPath() + "' key path: '" + GetDefaultKeyPath() + "' ca path: '" + GetDefaultCaPath() + "'.", GetDebugInfo())); @@ -338,7 +341,7 @@ bool ApiListener::AddListener(const String& node, const String& service) ObjectLock olock(this); - std::shared_ptr sslContext = m_SSLContext; + auto sslContext (m_SSLContext); if (!sslContext) { Log(LogCritical, "ApiListener", "SSL context is required for AddListener()"); @@ -389,7 +392,7 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint) { ObjectLock olock(this); - std::shared_ptr sslContext = m_SSLContext; + auto sslContext (m_SSLContext); if (!sslContext) { Log(LogCritical, "ApiListener", "SSL context is required for AddConnection()");