From ae25976afd6ec07d30e78ea0bc6aa555444f953b Mon Sep 17 00:00:00 2001 From: Will-Low Date: Fri, 28 Jun 2019 08:31:25 -0400 Subject: [PATCH] Fixing port logic (#5576) --- osquery/remote/http_client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osquery/remote/http_client.cpp b/osquery/remote/http_client.cpp index 1ab36e3a..6610b83a 100644 --- a/osquery/remote/http_client.cpp +++ b/osquery/remote/http_client.cpp @@ -201,7 +201,8 @@ void Client::sendRequest(STREAM_TYPE& stream, if (client_options_.ssl_connection_ && (kHTTPSDefaultPort != *client_options_.remote_port_)) { host_header_value += ':' + *client_options_.remote_port_; - } else if (kHTTPDefaultPort != *client_options_.remote_port_) { + } else if (!client_options_.ssl_connection_ && + kHTTPDefaultPort != *client_options_.remote_port_) { host_header_value += ':' + *client_options_.remote_port_; } req.set(beast_http::field::host, host_header_value);