diff --git a/CMakeLists.txt b/CMakeLists.txt index ce8dae05..b07ab26d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,13 +27,13 @@ else () message(CHECK_PASS "no") endif (ENABLE_TUI_SUPPORT) -option(ENABLE_TCP_SSL "Enable TCP SSL support" off) -message(CHECK_START "Enable TCP SSL support") -if (ENABLE_TCP_SSL) +option(ENABLE_SSL "Enable SSL support" off) +message(CHECK_START "Enable SSL support") +if (ENABLE_SSL) message(CHECK_PASS "yes") else () message(CHECK_PASS "no") -endif (ENABLE_TCP_SSL) +endif (ENABLE_SSL) option(DISABLE_WEBSOCKETS "Disable WebSocket support" off) if (DISABLE_WEBSOCKETS) @@ -54,8 +54,8 @@ if (COMPILE_WIN32) # No TUI for this set(ENABLE_TUI_SUPPORT OFF) message(CHECK_START "Enable TUI support - no; for simplicity WIN32 does not support TUI.") - set(ENABLE_TCP_SSL OFF) - message(CHECK_START "Enable TCP SSL support - no; for simplicity WIN32 does not support TCP SSL.") + set(ENABLE_SSL OFF) + message(CHECK_START "Enable SSL support - no; for simplicity WIN32 does not support SSL.") else() set(CMAKE_C_COMPILER /usr/bin/gcc CACHE STRING "C compiler") set(CMAKE_CXX_COMPILER /usr/bin/g++ CACHE STRING "C++ compiler") diff --git a/src/CompilerOptions.cmake b/src/CompilerOptions.cmake index 15a2e2b9..7103d2a0 100644 --- a/src/CompilerOptions.cmake +++ b/src/CompilerOptions.cmake @@ -17,9 +17,9 @@ else() set(ENABLE_SETUP_TUI off) endif (ENABLE_TUI_SUPPORT) -if (ENABLE_TCP_SSL) - add_definitions(-DENABLE_TCP_SSL) -endif (ENABLE_TCP_SSL) +if (ENABLE_SSL) + add_definitions(-DENABLE_SSL) +endif (ENABLE_SSL) option(DISABLE_TUI_APPS "Disable extra TUI applications" off) if (DISABLE_TUI_APPS) @@ -172,7 +172,7 @@ if (HAVE_SENDMMSG) endif (HAVE_SENDMMSG) # are we enabling SSL support? -if (ENABLE_TCP_SSL) +if (ENABLE_SSL) find_package(OpenSSL REQUIRED) include_directories("${OPENSSL_INCLUDE_DIR}") -endif (ENABLE_TCP_SSL) +endif (ENABLE_SSL) diff --git a/src/common/network/rest/http/SecureClientConnection.h b/src/common/network/rest/http/SecureClientConnection.h index 7611e97f..3ce83a85 100644 --- a/src/common/network/rest/http/SecureClientConnection.h +++ b/src/common/network/rest/http/SecureClientConnection.h @@ -17,7 +17,7 @@ #if !defined(__REST_HTTP__SECURE_CLIENT_CONNECTION_H__) #define __REST_HTTP__SECURE_CLIENT_CONNECTION_H__ -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) #include "common/Defines.h" #include "common/network/rest/http/HTTPLexer.h" @@ -262,6 +262,6 @@ namespace network } // namespace rest } // namespace network -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL #endif // __REST_HTTP__SECURE_CLIENT_CONNECTION_H__ diff --git a/src/common/network/rest/http/SecureHTTPClient.h b/src/common/network/rest/http/SecureHTTPClient.h index 3a68da5b..009e78f9 100644 --- a/src/common/network/rest/http/SecureHTTPClient.h +++ b/src/common/network/rest/http/SecureHTTPClient.h @@ -17,7 +17,7 @@ #if !defined(__REST_HTTP__SECURE_HTTP_CLIENT_H__) #define __REST_HTTP__SECURE_HTTP_CLIENT_H__ -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) #include "common/Defines.h" #include "common/network/rest/http/SecureClientConnection.h" @@ -204,6 +204,6 @@ namespace network } // namespace rest } // namespace network -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL #endif // __REST_HTTP__SECURE_HTTP_CLIENT_H__ diff --git a/src/common/network/rest/http/SecureHTTPServer.h b/src/common/network/rest/http/SecureHTTPServer.h index 84116cde..c19d5ab3 100644 --- a/src/common/network/rest/http/SecureHTTPServer.h +++ b/src/common/network/rest/http/SecureHTTPServer.h @@ -15,7 +15,7 @@ #if !defined(__REST_HTTP__SECURE_HTTP_SERVER_H__) #define __REST_HTTP__SECURE_HTTP_SERVER_H__ -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) #include "common/Defines.h" #include "common/network/rest/http/SecureServerConnection.h" @@ -186,6 +186,6 @@ namespace network } // namespace rest } // namespace network -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL #endif // __REST_HTTP__SECURE_HTTP_SERVER_H__ diff --git a/src/common/network/rest/http/SecureServerConnection.h b/src/common/network/rest/http/SecureServerConnection.h index ccd6d114..3b98033c 100644 --- a/src/common/network/rest/http/SecureServerConnection.h +++ b/src/common/network/rest/http/SecureServerConnection.h @@ -15,7 +15,7 @@ #if !defined(__REST_HTTP__SECURE_SERVER_CONNECTION_H__) #define __REST_HTTP__SECURE_SERVER_CONNECTION_H__ -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) #include "common/Defines.h" #include "common/network/rest/http/HTTPLexer.h" @@ -282,6 +282,6 @@ namespace network } // namespace rest } // namespace network -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL #endif // __REST_HTTP__SECURE_SERVER_CONNECTION_H__ diff --git a/src/common/network/tcp/SecureTcpClient.cpp b/src/common/network/tcp/SecureTcpClient.cpp index 6a99b59e..0b3d4b0f 100644 --- a/src/common/network/tcp/SecureTcpClient.cpp +++ b/src/common/network/tcp/SecureTcpClient.cpp @@ -10,7 +10,7 @@ #include "common/Defines.h" #include "common/network/tcp/SecureTcpClient.h" -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) using namespace network::tcp; @@ -20,4 +20,4 @@ using namespace network::tcp; std::string SecureTcpClient::m_sslHostname = std::string(); -#endif // ENABLE_TCP_SSL \ No newline at end of file +#endif // ENABLE_SSL \ No newline at end of file diff --git a/src/common/network/tcp/SecureTcpClient.h b/src/common/network/tcp/SecureTcpClient.h index 40e5938c..5e9ae415 100644 --- a/src/common/network/tcp/SecureTcpClient.h +++ b/src/common/network/tcp/SecureTcpClient.h @@ -16,7 +16,7 @@ #if !defined(__SECURE_TCP_CLIENT_H__) #define __SECURE_TCP_CLIENT_H__ -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) #include "Defines.h" #include "common/Log.h" @@ -296,6 +296,6 @@ namespace network } // namespace tcp } // namespace network -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL #endif // __SECURE_TCP_CLIENT_H__ diff --git a/src/common/network/tcp/SecureTcpListener.h b/src/common/network/tcp/SecureTcpListener.h index a94a7833..0b8ad912 100644 --- a/src/common/network/tcp/SecureTcpListener.h +++ b/src/common/network/tcp/SecureTcpListener.h @@ -17,7 +17,7 @@ #if !defined(__SECURE_TCP_SERVER_H__) #define __SECURE_TCP_SERVER_H__ -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) #include "Defines.h" #include "common/network/tcp/Socket.h" @@ -153,6 +153,6 @@ namespace network } // namespace tcp } // namespace network -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL #endif // __SECURE_TCP_SERVER_H__ diff --git a/src/fne/CryptoContainer.cpp b/src/fne/CryptoContainer.cpp index 3c0a2ffd..92b8e282 100644 --- a/src/fne/CryptoContainer.cpp +++ b/src/fne/CryptoContainer.cpp @@ -12,9 +12,9 @@ #include "common/Timer.h" #include "common/Utils.h" #include "common/zlib/zlib.h" -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) #include "xml/rapidxml.h" -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL #include "CryptoContainer.h" #include @@ -23,10 +23,10 @@ #include #include -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) #include #include -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL using namespace crypto; @@ -40,7 +40,7 @@ using namespace crypto; // Global Functions // --------------------------------------------------------------------------- -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) /** * @brief Calculates the length of a decoded base64 string. * @param b64input String containing the base64 encoded data. @@ -87,7 +87,7 @@ int base64Decode(char* b64message, uint8_t** buffer) return decodeLen; } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL /** * @brief @@ -145,11 +145,11 @@ CryptoContainer::CryptoContainer(const std::string& filename, const std::string& m_file(filename), m_password(password), m_reloadTime(reloadTime), -#if !defined(ENABLE_TCP_SSL) +#if !defined(ENABLE_SSL) m_enabled(false), #else m_enabled(enabled), -#endif // !ENABLE_TCP_SSL +#endif // !ENABLE_SSL m_stop(false), m_keys() { @@ -289,7 +289,7 @@ KeyItem CryptoContainer::find(uint32_t kId) bool CryptoContainer::load() { -#if !defined(ENABLE_TCP_SSL) +#if !defined(ENABLE_SSL) return false; #else if (!m_enabled) { @@ -571,5 +571,5 @@ bool CryptoContainer::load() LogInfoEx(LOG_HOST, "Loaded %lu entries into crypto lookup table", size); return true; -#endif // !ENABLE_TCP_SSL +#endif // !ENABLE_SSL } diff --git a/src/fne/HostFNE.cpp b/src/fne/HostFNE.cpp index d85ca145..1343d9d2 100644 --- a/src/fne/HostFNE.cpp +++ b/src/fne/HostFNE.cpp @@ -363,9 +363,9 @@ bool HostFNE::readParams() yaml::Node cryptoContainer = masterConf["crypto_container"]; bool cryptoContainerEnabled = cryptoContainer["enable"].as(false); -#if !defined(ENABLE_TCP_SSL) +#if !defined(ENABLE_SSL) cryptoContainerEnabled = false; -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL std::string cryptoContainerEKC = cryptoContainer["file"].as(); std::string cryptoContainerPassword = cryptoContainer["password"].as(); uint32_t cryptoContainerReload = cryptoContainer["time"].as(30U); diff --git a/src/fne/network/RESTAPI.cpp b/src/fne/network/RESTAPI.cpp index 4a366ed6..7364cc67 100644 --- a/src/fne/network/RESTAPI.cpp +++ b/src/fne/network/RESTAPI.cpp @@ -492,10 +492,10 @@ RESTAPI::RESTAPI(const std::string& address, uint16_t port, const std::string& p const std::string& keyFile, const std::string& certFile, bool enableSSL, HostFNE* host, bool debug) : m_dispatcher(debug), m_restServer(address, port, debug), -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) m_restSecureServer(address, port, debug), m_enableSSL(enableSSL), -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL m_random(), m_password(password), m_passwordHash(nullptr), @@ -529,14 +529,14 @@ RESTAPI::RESTAPI(const std::string& address, uint16_t port, const std::string& p Utils::dump("REST Password Hash", m_passwordHash, 32U); } -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { if (!m_restSecureServer.setCertAndKey(keyFile, certFile)) { m_enableSSL = false; ::LogError(LOG_REST, "failed to initialize SSL for HTTPS, disabling SSL"); } } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL std::random_device rd; std::mt19937 mt(rd()); @@ -568,17 +568,17 @@ void RESTAPI::setNetwork(network::FNENetwork* network) bool RESTAPI::open() { initializeEndpoints(); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { m_restSecureServer.open(); m_restSecureServer.setHandler(m_dispatcher); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL m_restServer.open(); m_restServer.setHandler(m_dispatcher); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL return run(); } @@ -587,15 +587,15 @@ bool RESTAPI::open() void RESTAPI::close() { -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { m_restSecureServer.stop(); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL m_restServer.stop(); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL wait(); } @@ -607,15 +607,15 @@ void RESTAPI::close() void RESTAPI::entry() { -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { m_restSecureServer.run(); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL m_restServer.run(); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL } /* Helper to initialize REST API endpoints. */ diff --git a/src/fne/network/RESTAPI.h b/src/fne/network/RESTAPI.h index d98c5edd..d0437e3d 100644 --- a/src/fne/network/RESTAPI.h +++ b/src/fne/network/RESTAPI.h @@ -93,10 +93,10 @@ private: typedef network::rest::http::HTTPPayload HTTPPayload; RESTDispatcherType m_dispatcher; network::rest::http::HTTPServer m_restServer; -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) network::rest::http::SecureHTTPServer m_restSecureServer; bool m_enableSSL; -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL std::mt19937 m_random; diff --git a/src/host/network/RESTAPI.cpp b/src/host/network/RESTAPI.cpp index 78537186..1c922c9d 100644 --- a/src/host/network/RESTAPI.cpp +++ b/src/host/network/RESTAPI.cpp @@ -140,10 +140,10 @@ RESTAPI::RESTAPI(const std::string& address, uint16_t port, const std::string& p const std::string& keyFile, const std::string& certFile, bool enableSSL, Host* host, bool debug) : m_dispatcher(debug), m_restServer(address, port, debug), -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) m_restSecureServer(address, port, debug), m_enableSSL(enableSSL), -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL m_random(), m_p25MFId(P25DEF::MFG_STANDARD), m_password(password), @@ -179,14 +179,14 @@ RESTAPI::RESTAPI(const std::string& address, uint16_t port, const std::string& p Utils::dump("REST Password Hash", m_passwordHash, 32U); } -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { if (!m_restSecureServer.setCertAndKey(keyFile, certFile)) { m_enableSSL = false; ::LogError(LOG_REST, "failed to initialize SSL for HTTPS, disabling SSL"); } } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL std::random_device rd; std::mt19937 mt(rd()); @@ -219,17 +219,17 @@ void RESTAPI::setProtocols(dmr::Control* dmr, p25::Control* p25, nxdn::Control* bool RESTAPI::open() { initializeEndpoints(); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { m_restSecureServer.open(); m_restSecureServer.setHandler(m_dispatcher); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL m_restServer.open(); m_restServer.setHandler(m_dispatcher); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL return run(); } @@ -238,15 +238,15 @@ bool RESTAPI::open() void RESTAPI::close() { -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { m_restSecureServer.stop(); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL m_restServer.stop(); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL wait(); } @@ -258,15 +258,15 @@ void RESTAPI::close() void RESTAPI::entry() { -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { m_restSecureServer.run(); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL m_restServer.run(); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL } /* Helper to initialize REST API endpoints. */ diff --git a/src/host/network/RESTAPI.h b/src/host/network/RESTAPI.h index b1d9dfc4..2cffa9e7 100644 --- a/src/host/network/RESTAPI.h +++ b/src/host/network/RESTAPI.h @@ -96,10 +96,10 @@ private: typedef network::rest::http::HTTPPayload HTTPPayload; RESTDispatcherType m_dispatcher; network::rest::http::HTTPServer m_restServer; -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) network::rest::http::SecureHTTPServer m_restSecureServer; bool m_enableSSL; -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL std::mt19937 m_random; diff --git a/src/remote/RESTClient.cpp b/src/remote/RESTClient.cpp index de5cf11a..01fbe510 100644 --- a/src/remote/RESTClient.cpp +++ b/src/remote/RESTClient.cpp @@ -152,13 +152,13 @@ int RESTClient::send(const std::string& address, uint32_t port, const std::strin typedef network::rest::BasicRequestDispatcher RESTDispatcherType; RESTDispatcherType m_dispatcher(RESTClient::responseHandler); HTTPClient* client = nullptr; -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) SecureHTTPClient* sslClient = nullptr; -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL try { // setup HTTP client for authentication payload -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { sslClient = new SecureHTTPClient(address, port); if (!sslClient->open()) { @@ -167,16 +167,16 @@ int RESTClient::send(const std::string& address, uint32_t port, const std::strin } sslClient->setHandler(m_dispatcher); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL client = new HTTPClient(address, port); if (!client->open()) { delete client; return ERRNO_SOCK_OPEN; } client->setHandler(m_dispatcher); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL // generate password SHA hash size_t size = password.size(); @@ -207,29 +207,29 @@ int RESTClient::send(const std::string& address, uint32_t port, const std::strin HTTPPayload httpPayload = HTTPPayload::requestPayload(HTTP_PUT, "/auth"); httpPayload.payload(request); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { sslClient->request(httpPayload); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL client->request(httpPayload); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL // wait for response and parse if (wait()) { -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { sslClient->close(); delete sslClient; } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL client->close(); delete client; -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL return ERRNO_API_CALL_TIMEOUT; } @@ -244,34 +244,34 @@ int RESTClient::send(const std::string& address, uint32_t port, const std::strin token = rsp["token"].get(); } else { -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { sslClient->close(); delete sslClient; } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL client->close(); delete client; -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL return ERRNO_BAD_AUTH_RESPONSE; } -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { sslClient->close(); delete sslClient; } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL client->close(); delete client; -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL // reset the HTTP client and setup for actual payload request -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { sslClient = new SecureHTTPClient(address, port); if (!sslClient->open()) { @@ -280,44 +280,44 @@ int RESTClient::send(const std::string& address, uint32_t port, const std::strin } sslClient->setHandler(m_dispatcher); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL client = new HTTPClient(address, port); if (!client->open()) { delete client; return ERRNO_SOCK_OPEN; } client->setHandler(m_dispatcher); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL // send actual API request httpPayload = HTTPPayload::requestPayload(method, endpoint); httpPayload.headers.add("X-DVM-Auth-Token", token); httpPayload.payload(payload); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { sslClient->request(httpPayload); } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL client->request(httpPayload); -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL // wait for response and parse if (wait()) { -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { sslClient->close(); delete sslClient; } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL client->close(); delete client; -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL return ERRNO_API_CALL_TIMEOUT; } @@ -339,32 +339,32 @@ int RESTClient::send(const std::string& address, uint32_t port, const std::strin } } -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { sslClient->close(); delete sslClient; } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL client->close(); delete client; -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL } catch (std::exception&) { -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) if (m_enableSSL) { if (sslClient != nullptr) { delete sslClient; } } else { -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL if (client != nullptr) { delete client; } -#if defined(ENABLE_TCP_SSL) +#if defined(ENABLE_SSL) } -#endif // ENABLE_TCP_SSL +#endif // ENABLE_SSL return ERRNO_INTERNAL_ERROR; }