Commit 13b9b5cb authored by Michael Ott's avatar Michael Ott
Browse files

Reduce verbosity of HTTPS handshake errors

parent e4383ac8
......@@ -113,7 +113,7 @@ RESTHttpsServer::RESTHttpsServer(serverSettings_t settings) :
void RESTHttpsServer::handle_session(tcp::socket& socket, ssl::context& ctx) {
ServerLOG(info) << _remoteEndpoint.address().to_string() << ":"
ServerLOG(debug) << _remoteEndpoint.address().to_string() << ":"
<< _remoteEndpoint.port() << " connecting";
bool close = false;
......@@ -125,7 +125,7 @@ void RESTHttpsServer::handle_session(tcp::socket& socket, ssl::context& ctx) {
// Perform the SSL handshake
stream.handshake(ssl::stream_base::server, ec);
if(ec) {
ServerLOG(error) << "handshake: " << ec.message();
ServerLOG(debug) << "handshake error: " << ec.message();
goto serverError;
}
......@@ -145,7 +145,7 @@ void RESTHttpsServer::handle_session(tcp::socket& socket, ssl::context& ctx) {
break;
}
if(ec) {
ServerLOG(error) << "read: " << ec.message();
ServerLOG(debug) << "read error: " << ec.message();
goto serverError;
}
......@@ -157,7 +157,7 @@ void RESTHttpsServer::handle_session(tcp::socket& socket, ssl::context& ctx) {
handle_request(req, lambda);
if(ec) {
ServerLOG(error) << "write: " << ec.message();
ServerLOG(debug) << "write error: " << ec.message();
goto serverError;
}
if(close) {
......@@ -170,7 +170,7 @@ void RESTHttpsServer::handle_session(tcp::socket& socket, ssl::context& ctx) {
// Perform the SSL shutdown
stream.shutdown(ec);
if(ec) { ServerLOG(error) << "stream shutdown: " << ec.message(); }
if(ec) { ServerLOG(debug) << "stream shutdown error: " << ec.message(); }
serverError:
//For graceful closure of a connected socket we shut it down first although
......@@ -180,7 +180,7 @@ serverError:
if(ec) { ServerLOG(debug) << "socket shutdown: " << ec.message(); }
socket.close(ec);
if(ec) { ServerLOG(error) << "socket close: " << ec.message(); }
if(ec) { ServerLOG(debug) << "socket close error: " << ec.message(); }
startAccept();
}
......@@ -203,17 +203,17 @@ void RESTHttpsServer::handle_request(http::request<Body>& req, Send&& send) {
if (endpoint.first == req.method()) {
//Everything matches --> call the endpoint function
ServerLOG(info) << req.method_string() << " " << endpointName << " requested";
ServerLOG(debug) << req.method_string() << " " << endpointName << " requested";
endpoint.second(req, res, queries);
} else {
const std::string msg = "Request method " + req.method_string().to_string() +
" does not match endpoint " + endpointName + "\n";
ServerLOG(info) << msg;
ServerLOG(debug) << msg;
res.result(http::status::bad_request);
res.body() = msg;
}
} catch (const std::out_of_range& e) {
ServerLOG(info) << "Requested endpoint " << endpointName << " not found";
ServerLOG(debug) << "Requested endpoint " << endpointName << " not found";
res.result(http::status::not_implemented);
res.body() = "Invalid endpoint\n";
}
......@@ -331,7 +331,7 @@ bool RESTHttpsServer::validateUser(const http::request<Body>& req, Send&& send)
return false;
}
} catch (const std::out_of_range& e) {
ServerLOG(error) << "Permission out of range (method not supported)";
ServerLOG(debug) << "Permission out of range (method not supported)";
res.result(http::status::not_implemented);
res.body() = "Request method not supported!\n";
res.prepare_payload();
......@@ -347,7 +347,7 @@ std::string RESTHttpsServer::splitUri(const std::string& uri, queries_t& queries
std::string path;
std::string query;
ServerLOG(debug) << "Splitting URI " << uri;
//ServerLOG(debug) << "Splitting URI " << uri;
size_t pos = uri.find('?');
path = uri.substr(0, pos);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment