Clean up BMCWEB_ENABLE_SSL
This macro came originally from CROW_ENABLE_SSL, and was used as a macro
to optionally compile without openssl being required.
OpenSSL has been pulled into many other dependencies, and has been
functionally required to be included for a long time, so there's no
reason to hold onto this macro.
Remove most uses of the macro, and for the couple functional places the
macro is used, transition to a constexpr if to enable the TLS paths.
This allows a large simplification of code in some places.
Tested: Redfish service validator passes.
Change-Id: Iebd46a68e5e417b6031479e24be3c21bef782f4c
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/http/routing/baserule.hpp b/http/routing/baserule.hpp
index 0913020..f99e16e 100644
--- a/http/routing/baserule.hpp
+++ b/http/routing/baserule.hpp
@@ -37,7 +37,6 @@
virtual void handle(const Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>&,
const std::vector<std::string>&) = 0;
-#ifndef BMCWEB_ENABLE_SSL
virtual void
handleUpgrade(const Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -45,7 +44,7 @@
{
asyncResp->res.result(boost::beast::http::status::not_found);
}
-#else
+
virtual void handleUpgrade(
const Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -53,7 +52,6 @@
{
asyncResp->res.result(boost::beast::http::status::not_found);
}
-#endif
size_t getMethods() const
{
diff --git a/http/routing/sserule.hpp b/http/routing/sserule.hpp
index c0a4e50..ad05baf 100644
--- a/http/routing/sserule.hpp
+++ b/http/routing/sserule.hpp
@@ -30,7 +30,6 @@
asyncResp->res.result(boost::beast::http::status::not_found);
}
-#ifndef BMCWEB_ENABLE_SSL
void handleUpgrade(const Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& /*asyncResp*/,
boost::asio::ip::tcp::socket&& adaptor) override
@@ -42,7 +41,6 @@
std::move(adaptor), openHandler, closeHandler);
myConnection->start();
}
-#else
void handleUpgrade(const Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>& /*asyncResp*/,
boost::beast::ssl_stream<boost::asio::ip::tcp::socket>&&
@@ -55,7 +53,6 @@
std::move(adaptor), openHandler, closeHandler);
myConnection->start();
}
-#endif
template <typename Func>
self_t& onopen(Func f)
diff --git a/http/routing/websocketrule.hpp b/http/routing/websocketrule.hpp
index bf6daad..b52d9ec 100644
--- a/http/routing/websocketrule.hpp
+++ b/http/routing/websocketrule.hpp
@@ -27,7 +27,6 @@
asyncResp->res.result(boost::beast::http::status::not_found);
}
-#ifndef BMCWEB_ENABLE_SSL
void handleUpgrade(const Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& /*asyncResp*/,
boost::asio::ip::tcp::socket&& adaptor) override
@@ -41,7 +40,7 @@
messageHandler, messageExHandler, closeHandler, errorHandler);
myConnection->start(req);
}
-#else
+
void handleUpgrade(const Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& /*asyncResp*/,
boost::beast::ssl_stream<boost::asio::ip::tcp::socket>&&
@@ -56,7 +55,6 @@
messageHandler, messageExHandler, closeHandler, errorHandler);
myConnection->start(req);
}
-#endif
template <typename Func>
self_t& onopen(Func f)