diff --git a/lib/base/netstring.cpp b/lib/base/netstring.cpp index 60f08c265..7dbef4ccf 100644 --- a/lib/base/netstring.cpp +++ b/lib/base/netstring.cpp @@ -126,7 +126,7 @@ size_t NetString::WriteStringToStream(const Stream::Ptr& stream, const String& s * @exception invalid_argument The input stream is invalid. * @see https://github.com/PeterScott/netstring-c/blob/master/netstring.c */ -String NetString::ReadStringFromStream(const Shared::Ptr& stream, +String NetString::ReadStringFromStream(const AsioTlsStream::Ptr& stream, ssize_t maxMessageLength) { namespace asio = boost::asio; @@ -205,7 +205,7 @@ String NetString::ReadStringFromStream(const Shared::Ptr& stream, * @exception invalid_argument The input stream is invalid. * @see https://github.com/PeterScott/netstring-c/blob/master/netstring.c */ -String NetString::ReadStringFromStream(const Shared::Ptr& stream, +String NetString::ReadStringFromStream(const AsioTlsStream::Ptr& stream, boost::asio::yield_context yc, ssize_t maxMessageLength) { namespace asio = boost::asio; @@ -284,7 +284,7 @@ String NetString::ReadStringFromStream(const Shared::Ptr& stream, * * @return The amount of bytes written. */ -size_t NetString::WriteStringToStream(const Shared::Ptr& stream, const String& str) +size_t NetString::WriteStringToStream(const AsioTlsStream::Ptr& stream, const String& str) { namespace asio = boost::asio; @@ -307,7 +307,7 @@ size_t NetString::WriteStringToStream(const Shared::Ptr& stream, * * @return The amount of bytes written. */ -size_t NetString::WriteStringToStream(const Shared::Ptr& stream, const String& str, boost::asio::yield_context yc) +size_t NetString::WriteStringToStream(const AsioTlsStream::Ptr& stream, const String& str, boost::asio::yield_context yc) { namespace asio = boost::asio; diff --git a/lib/base/netstring.hpp b/lib/base/netstring.hpp index e5ec051de..39493eceb 100644 --- a/lib/base/netstring.hpp +++ b/lib/base/netstring.hpp @@ -26,12 +26,12 @@ class NetString public: static StreamReadStatus ReadStringFromStream(const Stream::Ptr& stream, String *message, StreamReadContext& context, bool may_wait = false, ssize_t maxMessageLength = -1); - static String ReadStringFromStream(const Shared::Ptr& stream, ssize_t maxMessageLength = -1); - static String ReadStringFromStream(const Shared::Ptr& stream, + static String ReadStringFromStream(const AsioTlsStream::Ptr& stream, ssize_t maxMessageLength = -1); + static String ReadStringFromStream(const AsioTlsStream::Ptr& stream, boost::asio::yield_context yc, ssize_t maxMessageLength = -1); static size_t WriteStringToStream(const Stream::Ptr& stream, const String& message); - static size_t WriteStringToStream(const Shared::Ptr& stream, const String& message); - static size_t WriteStringToStream(const Shared::Ptr& stream, const String& message, boost::asio::yield_context yc); + static size_t WriteStringToStream(const AsioTlsStream::Ptr& stream, const String& message); + static size_t WriteStringToStream(const AsioTlsStream::Ptr& stream, const String& message, boost::asio::yield_context yc); static void WriteStringToStream(std::ostream& stream, const String& message); private: diff --git a/lib/base/tlsstream.hpp b/lib/base/tlsstream.hpp index 9a6340baf..0e0d0489c 100644 --- a/lib/base/tlsstream.hpp +++ b/lib/base/tlsstream.hpp @@ -4,7 +4,7 @@ #define TLSSTREAM_H #include "base/i2-base.hpp" -#include "base/shared.hpp" +#include "base/shared-object.hpp" #include "base/socket.hpp" #include "base/stream.hpp" #include "base/tlsutility.hpp" @@ -102,15 +102,22 @@ private: void BeforeHandshake(handshake_type type); }; -class AsioTlsStream : public boost::asio::buffered_stream +class AsioTlsStream : public SharedObject, public boost::asio::buffered_stream { public: + DECLARE_PTR_TYPEDEFS(AsioTlsStream); + inline AsioTlsStream(boost::asio::io_context& ioContext, boost::asio::ssl::context& sslContext, const String& hostname = String()) : AsioTlsStream(UnbufferedAsioTlsStreamParams{ioContext, sslContext, hostname}) { } + static AsioTlsStream::Ptr Make(boost::asio::io_context& ioContext, boost::asio::ssl::context& sslContext, const String& hostname = String()) + { + return new AsioTlsStream(ioContext, sslContext, hostname); + } + private: inline AsioTlsStream(UnbufferedAsioTlsStreamParams init) @@ -120,7 +127,7 @@ private: }; typedef boost::asio::buffered_stream AsioTcpStream; -typedef std::pair::Ptr, Shared::Ptr> OptionalTlsStream; +typedef std::pair::Ptr> OptionalTlsStream; } diff --git a/lib/cli/consolecommand.cpp b/lib/cli/consolecommand.cpp index 78906bb2a..a6cdd80d2 100644 --- a/lib/cli/consolecommand.cpp +++ b/lib/cli/consolecommand.cpp @@ -42,7 +42,7 @@ namespace po = boost::program_options; static ScriptFrame *l_ScriptFrame; static Url::Ptr l_Url; -static Shared::Ptr l_TlsStream; +static AsioTlsStream::Ptr l_TlsStream; static String l_Session; REGISTER_CLICOMMAND("console", ConsoleCommand); @@ -522,7 +522,7 @@ incomplete: * * @returns AsioTlsStream pointer for future HTTP connections. */ -Shared::Ptr ConsoleCommand::Connect() +AsioTlsStream::Ptr ConsoleCommand::Connect() { Shared::Ptr sslContext; @@ -537,7 +537,7 @@ Shared::Ptr ConsoleCommand::Connect() String host = l_Url->GetHost(); String port = l_Url->GetPort(); - Shared::Ptr stream = Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, host); + AsioTlsStream::Ptr stream = AsioTlsStream::Make(IoEngine::Get().GetIoContext(), *sslContext, host); try { icinga::Connect(stream->lowest_layer(), host, port); diff --git a/lib/cli/consolecommand.hpp b/lib/cli/consolecommand.hpp index 631ec2164..d8e82e312 100644 --- a/lib/cli/consolecommand.hpp +++ b/lib/cli/consolecommand.hpp @@ -41,7 +41,7 @@ private: mutable std::mutex m_Mutex; mutable std::condition_variable m_CV; - static Shared::Ptr Connect(); + static AsioTlsStream::Ptr Connect(); static Value ExecuteScript(const String& session, const String& command, bool sandboxed); static Array::Ptr AutoCompleteScript(const String& session, const String& command, bool sandboxed); diff --git a/lib/icingadb/redisconnection.cpp b/lib/icingadb/redisconnection.cpp index c187d7f1e..01bd214d3 100644 --- a/lib/icingadb/redisconnection.cpp +++ b/lib/icingadb/redisconnection.cpp @@ -315,7 +315,7 @@ void RedisConnection::Connect(asio::yield_context& yc) Log(m_Parent ? LogNotice : LogInformation, "IcingaDB") << "Trying to connect to Redis server (async, TLS) on host '" << m_Host << ":" << m_Port << "'"; - auto conn (Shared::Make(m_Strand.context(), *m_TLSContext, m_Host)); + auto conn (AsioTlsStream::Make(m_Strand.context(), *m_TLSContext, m_Host)); auto& tlsConn (conn->next_layer()); auto connectTimeout (MakeTimeout(conn)); Defer cancelTimeout ([&connectTimeout]() { connectTimeout->Cancel(); }); diff --git a/lib/icingadb/redisconnection.hpp b/lib/icingadb/redisconnection.hpp index fecd236f9..1f6557edf 100644 --- a/lib/icingadb/redisconnection.hpp +++ b/lib/icingadb/redisconnection.hpp @@ -244,7 +244,7 @@ namespace icinga boost::asio::io_context::strand m_Strand; Shared::Ptr m_TcpConn; Shared::Ptr m_UnixConn; - Shared::Ptr m_TlsConn; + AsioTlsStream::Ptr m_TlsConn; Atomic m_Connecting, m_Connected, m_Started; struct { diff --git a/lib/methods/ifwapichecktask.cpp b/lib/methods/ifwapichecktask.cpp index 16e2f7e63..2f5ff9c6c 100644 --- a/lib/methods/ifwapichecktask.cpp +++ b/lib/methods/ifwapichecktask.cpp @@ -449,7 +449,7 @@ void IfwApiCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes return; } - auto conn (Shared::Make(io, *ctx, expectedSan)); + auto conn (AsioTlsStream::Make(io, *ctx, expectedSan)); IoEngine::SpawnCoroutine( *strand, diff --git a/lib/perfdata/elasticsearchwriter.cpp b/lib/perfdata/elasticsearchwriter.cpp index 9fb2aa90f..d0194552e 100644 --- a/lib/perfdata/elasticsearchwriter.cpp +++ b/lib/perfdata/elasticsearchwriter.cpp @@ -612,7 +612,7 @@ OptionalTlsStream ElasticsearchWriter::Connect() throw; } - stream.first = Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost()); + stream.first = AsioTlsStream::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost()); } else { stream.second = Shared::Make(IoEngine::Get().GetIoContext()); diff --git a/lib/perfdata/gelfwriter.cpp b/lib/perfdata/gelfwriter.cpp index c5b2bbd13..2b64b77a4 100644 --- a/lib/perfdata/gelfwriter.cpp +++ b/lib/perfdata/gelfwriter.cpp @@ -184,7 +184,7 @@ void GelfWriter::ReconnectInternal() throw; } - m_Stream.first = Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost()); + m_Stream.first = AsioTlsStream::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost()); } else { m_Stream.second = Shared::Make(IoEngine::Get().GetIoContext()); diff --git a/lib/perfdata/influxdbcommonwriter.cpp b/lib/perfdata/influxdbcommonwriter.cpp index d5aaa7c98..f5bd0b77b 100644 --- a/lib/perfdata/influxdbcommonwriter.cpp +++ b/lib/perfdata/influxdbcommonwriter.cpp @@ -158,7 +158,7 @@ OptionalTlsStream InfluxdbCommonWriter::Connect() throw; } - stream.first = Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost()); + stream.first = AsioTlsStream::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost()); } else { stream.second = Shared::Make(IoEngine::Get().GetIoContext()); diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 201b22865..32e63daf7 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -526,7 +526,7 @@ void ApiListener::ListenerCoroutineProc(boost::asio::yield_context yc, const Sha } boost::shared_lock lock (m_SSLContextMutex); - auto sslConn (Shared::Make(io, *m_SSLContext)); + auto sslConn (AsioTlsStream::Make(io, *m_SSLContext)); lock.unlock(); sslConn->lowest_layer() = std::move(socket); @@ -581,7 +581,7 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint) try { boost::shared_lock lock (m_SSLContextMutex); - auto sslConn (Shared::Make(io, *m_SSLContext, endpoint->GetName())); + auto sslConn (AsioTlsStream::Make(io, *m_SSLContext, endpoint->GetName())); lock.unlock(); @@ -615,7 +615,7 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint) void ApiListener::NewClientHandler( boost::asio::yield_context yc, const Shared::Ptr& strand, - const Shared::Ptr& client, const String& hostname, ConnectionRole role + const AsioTlsStream::Ptr& client, const String& hostname, ConnectionRole role ) { try { @@ -654,7 +654,7 @@ static const auto l_MyCapabilities ( */ void ApiListener::NewClientHandlerInternal( boost::asio::yield_context yc, const Shared::Ptr& strand, - const Shared::Ptr& client, const String& hostname, ConnectionRole role + const AsioTlsStream::Ptr& client, const String& hostname, ConnectionRole role ) { namespace asio = boost::asio; diff --git a/lib/remote/apilistener.hpp b/lib/remote/apilistener.hpp index fced0a8af..9268216df 100644 --- a/lib/remote/apilistener.hpp +++ b/lib/remote/apilistener.hpp @@ -191,11 +191,11 @@ private: void NewClientHandler( boost::asio::yield_context yc, const Shared::Ptr& strand, - const Shared::Ptr& client, const String& hostname, ConnectionRole role + const AsioTlsStream::Ptr& client, const String& hostname, ConnectionRole role ); void NewClientHandlerInternal( boost::asio::yield_context yc, const Shared::Ptr& strand, - const Shared::Ptr& client, const String& hostname, ConnectionRole role + const AsioTlsStream::Ptr& client, const String& hostname, ConnectionRole role ); void ListenerCoroutineProc(boost::asio::yield_context yc, const Shared::Ptr& server); diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp index b9a8ab814..60e4a721d 100644 --- a/lib/remote/httpserverconnection.cpp +++ b/lib/remote/httpserverconnection.cpp @@ -35,12 +35,12 @@ using namespace icinga; auto const l_ServerHeader ("Icinga/" + Application::GetAppVersion()); -HttpServerConnection::HttpServerConnection(const String& identity, bool authenticated, const Shared::Ptr& stream) +HttpServerConnection::HttpServerConnection(const String& identity, bool authenticated, const AsioTlsStream::Ptr& stream) : HttpServerConnection(identity, authenticated, stream, IoEngine::Get().GetIoContext()) { } -HttpServerConnection::HttpServerConnection(const String& identity, bool authenticated, const Shared::Ptr& stream, boost::asio::io_context& io) +HttpServerConnection::HttpServerConnection(const String& identity, bool authenticated, const AsioTlsStream::Ptr& stream, boost::asio::io_context& io) : m_Stream(stream), m_Seen(Utility::GetTime()), m_IoStrand(io), m_ShuttingDown(false), m_HasStartedStreaming(false), m_CheckLivenessTimer(io) { diff --git a/lib/remote/httpserverconnection.hpp b/lib/remote/httpserverconnection.hpp index 9c812e526..050c3bb38 100644 --- a/lib/remote/httpserverconnection.hpp +++ b/lib/remote/httpserverconnection.hpp @@ -25,7 +25,7 @@ class HttpServerConnection final : public Object public: DECLARE_PTR_TYPEDEFS(HttpServerConnection); - HttpServerConnection(const String& identity, bool authenticated, const Shared::Ptr& stream); + HttpServerConnection(const String& identity, bool authenticated, const AsioTlsStream::Ptr& stream); void Start(); void Disconnect(); @@ -35,7 +35,7 @@ public: private: ApiUser::Ptr m_ApiUser; - Shared::Ptr m_Stream; + AsioTlsStream::Ptr m_Stream; double m_Seen; String m_PeerAddress; boost::asio::io_context::strand m_IoStrand; @@ -43,7 +43,7 @@ private: bool m_HasStartedStreaming; boost::asio::deadline_timer m_CheckLivenessTimer; - HttpServerConnection(const String& identity, bool authenticated, const Shared::Ptr& stream, boost::asio::io_context& io); + HttpServerConnection(const String& identity, bool authenticated, const AsioTlsStream::Ptr& stream, boost::asio::io_context& io); void ProcessMessages(boost::asio::yield_context yc); void CheckLiveness(boost::asio::yield_context yc); diff --git a/lib/remote/jsonrpc.cpp b/lib/remote/jsonrpc.cpp index d4d3d3cb3..a650a61e2 100644 --- a/lib/remote/jsonrpc.cpp +++ b/lib/remote/jsonrpc.cpp @@ -52,7 +52,7 @@ static bool GetDebugJsonRpcCached() * * @return The amount of bytes sent. */ -size_t JsonRpc::SendMessage(const Shared::Ptr& stream, const Dictionary::Ptr& message) +size_t JsonRpc::SendMessage(const AsioTlsStream::Ptr& stream, const Dictionary::Ptr& message) { String json = JsonEncode(message); @@ -71,7 +71,7 @@ size_t JsonRpc::SendMessage(const Shared::Ptr& stream, const Dict * * @return The amount of bytes sent. */ -size_t JsonRpc::SendMessage(const Shared::Ptr& stream, const Dictionary::Ptr& message, boost::asio::yield_context yc) +size_t JsonRpc::SendMessage(const AsioTlsStream::Ptr& stream, const Dictionary::Ptr& message, boost::asio::yield_context yc) { return JsonRpc::SendRawMessage(stream, JsonEncode(message), yc); } @@ -85,7 +85,7 @@ size_t JsonRpc::SendMessage(const Shared::Ptr& stream, const Dict * * @return bytes sent */ -size_t JsonRpc::SendRawMessage(const Shared::Ptr& stream, const String& json, boost::asio::yield_context yc) +size_t JsonRpc::SendRawMessage(const AsioTlsStream::Ptr& stream, const String& json, boost::asio::yield_context yc) { #ifdef I2_DEBUG if (GetDebugJsonRpcCached()) @@ -104,7 +104,7 @@ size_t JsonRpc::SendRawMessage(const Shared::Ptr& stream, const S * @return A JSON string */ -String JsonRpc::ReadMessage(const Shared::Ptr& stream, ssize_t maxMessageLength) +String JsonRpc::ReadMessage(const AsioTlsStream::Ptr& stream, ssize_t maxMessageLength) { String jsonString = NetString::ReadStringFromStream(stream, maxMessageLength); @@ -125,7 +125,7 @@ String JsonRpc::ReadMessage(const Shared::Ptr& stream, ssize_t ma * * @return A JSON string */ -String JsonRpc::ReadMessage(const Shared::Ptr& stream, boost::asio::yield_context yc, ssize_t maxMessageLength) +String JsonRpc::ReadMessage(const AsioTlsStream::Ptr& stream, boost::asio::yield_context yc, ssize_t maxMessageLength) { String jsonString = NetString::ReadStringFromStream(stream, yc, maxMessageLength); diff --git a/lib/remote/jsonrpc.hpp b/lib/remote/jsonrpc.hpp index 3f3cdec88..86c0e4ca9 100644 --- a/lib/remote/jsonrpc.hpp +++ b/lib/remote/jsonrpc.hpp @@ -21,12 +21,12 @@ namespace icinga class JsonRpc { public: - static size_t SendMessage(const Shared::Ptr& stream, const Dictionary::Ptr& message); - static size_t SendMessage(const Shared::Ptr& stream, const Dictionary::Ptr& message, boost::asio::yield_context yc); - static size_t SendRawMessage(const Shared::Ptr& stream, const String& json, boost::asio::yield_context yc); + static size_t SendMessage(const AsioTlsStream::Ptr& stream, const Dictionary::Ptr& message); + static size_t SendMessage(const AsioTlsStream::Ptr& stream, const Dictionary::Ptr& message, boost::asio::yield_context yc); + static size_t SendRawMessage(const AsioTlsStream::Ptr& stream, const String& json, boost::asio::yield_context yc); - static String ReadMessage(const Shared::Ptr& stream, ssize_t maxMessageLength = -1); - static String ReadMessage(const Shared::Ptr& stream, boost::asio::yield_context yc, ssize_t maxMessageLength = -1); + static String ReadMessage(const AsioTlsStream::Ptr& stream, ssize_t maxMessageLength = -1); + static String ReadMessage(const AsioTlsStream::Ptr& stream, boost::asio::yield_context yc, ssize_t maxMessageLength = -1); static Dictionary::Ptr DecodeMessage(const String& message); diff --git a/lib/remote/jsonrpcconnection.cpp b/lib/remote/jsonrpcconnection.cpp index cd684af6e..237b338b9 100644 --- a/lib/remote/jsonrpcconnection.cpp +++ b/lib/remote/jsonrpcconnection.cpp @@ -30,13 +30,13 @@ REGISTER_APIFUNCTION(SetLogPosition, log, &SetLogPositionHandler); static RingBuffer l_TaskStats (15 * 60); JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated, - const Shared::Ptr& stream, ConnectionRole role) + const AsioTlsStream::Ptr& stream, ConnectionRole role) : JsonRpcConnection(identity, authenticated, stream, role, IoEngine::Get().GetIoContext()) { } JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated, - const Shared::Ptr& stream, ConnectionRole role, boost::asio::io_context& io) + const AsioTlsStream::Ptr& stream, ConnectionRole role, boost::asio::io_context& io) : m_Identity(identity), m_Authenticated(authenticated), m_Stream(stream), m_Role(role), m_Timestamp(Utility::GetTime()), m_Seen(Utility::GetTime()), m_IoStrand(io), m_OutgoingMessagesQueued(io), m_WriterDone(io), m_ShuttingDown(false), @@ -151,7 +151,7 @@ Endpoint::Ptr JsonRpcConnection::GetEndpoint() const return m_Endpoint; } -Shared::Ptr JsonRpcConnection::GetStream() const +AsioTlsStream::Ptr JsonRpcConnection::GetStream() const { return m_Stream; } diff --git a/lib/remote/jsonrpcconnection.hpp b/lib/remote/jsonrpcconnection.hpp index bbe8588a1..3ecf76d5d 100644 --- a/lib/remote/jsonrpcconnection.hpp +++ b/lib/remote/jsonrpcconnection.hpp @@ -43,7 +43,7 @@ class JsonRpcConnection final : public Object public: DECLARE_PTR_TYPEDEFS(JsonRpcConnection); - JsonRpcConnection(const String& identity, bool authenticated, const Shared::Ptr& stream, ConnectionRole role); + JsonRpcConnection(const String& identity, bool authenticated, const AsioTlsStream::Ptr& stream, ConnectionRole role); void Start(); @@ -51,7 +51,7 @@ public: String GetIdentity() const; bool IsAuthenticated() const; Endpoint::Ptr GetEndpoint() const; - Shared::Ptr GetStream() const; + AsioTlsStream::Ptr GetStream() const; ConnectionRole GetRole() const; void Disconnect(); @@ -69,7 +69,7 @@ private: String m_Identity; bool m_Authenticated; Endpoint::Ptr m_Endpoint; - Shared::Ptr m_Stream; + AsioTlsStream::Ptr m_Stream; ConnectionRole m_Role; double m_Timestamp; double m_Seen; @@ -80,7 +80,7 @@ private: Atomic m_ShuttingDown; boost::asio::deadline_timer m_CheckLivenessTimer, m_HeartbeatTimer; - JsonRpcConnection(const String& identity, bool authenticated, const Shared::Ptr& stream, ConnectionRole role, boost::asio::io_context& io); + JsonRpcConnection(const String& identity, bool authenticated, const AsioTlsStream::Ptr& stream, ConnectionRole role, boost::asio::io_context& io); void HandleIncomingMessages(boost::asio::yield_context yc); void WriteOutgoingMessages(boost::asio::yield_context yc); diff --git a/lib/remote/pkiutility.cpp b/lib/remote/pkiutility.cpp index e49356559..d60102a2b 100644 --- a/lib/remote/pkiutility.cpp +++ b/lib/remote/pkiutility.cpp @@ -95,7 +95,7 @@ std::shared_ptr PkiUtility::FetchCert(const String& host, const String& po return std::shared_ptr(); } - auto stream (Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, host)); + auto stream (AsioTlsStream::Make(IoEngine::Get().GetIoContext(), *sslContext, host)); try { Connect(stream->lowest_layer(), host, port); @@ -163,7 +163,7 @@ int PkiUtility::RequestCertificate(const String& host, const String& port, const return 1; } - auto stream (Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, host)); + auto stream (AsioTlsStream::Make(IoEngine::Get().GetIoContext(), *sslContext, host)); try { Connect(stream->lowest_layer(), host, port); diff --git a/plugins/check_nscp_api.cpp b/plugins/check_nscp_api.cpp index aef43fb98..f3d7c6ffb 100644 --- a/plugins/check_nscp_api.cpp +++ b/plugins/check_nscp_api.cpp @@ -174,7 +174,7 @@ static int FormatOutput(const Dictionary::Ptr& result) * * @returns AsioTlsStream pointer for future HTTP connections. */ -static Shared::Ptr Connect(const String& host, const String& port) +static AsioTlsStream::Ptr Connect(const String& host, const String& port) { Shared::Ptr sslContext; @@ -186,7 +186,7 @@ static Shared::Ptr Connect(const String& host, const String& port throw; } - Shared::Ptr stream = Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, host); + AsioTlsStream::Ptr stream = AsioTlsStream::Make(IoEngine::Get().GetIoContext(), *sslContext, host); try { icinga::Connect(stream->lowest_layer(), host, port); @@ -338,7 +338,7 @@ static Dictionary::Ptr FetchData(const String& host, const String& port, const S namespace beast = boost::beast; namespace http = beast::http; - Shared::Ptr tlsStream; + AsioTlsStream::Ptr tlsStream; try { tlsStream = Connect(host, port);