Skip to content

Commit 66ba177

Browse files
authored
Merge pull request #646 from dimarusyy/master
#643 : ssl proxy port is hard coded to 443
2 parents 0f237e2 + 3f04578 commit 66ba177

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Release/src/http/client/http_client_asio.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,13 @@ class asio_context : public request_context, public std::enable_shared_from_this
450450

451451
const auto &base_uri = m_context->m_http_client->base_uri();
452452
const auto &host = utility::conversions::to_utf8string(base_uri.host());
453+
const auto &port = base_uri.port();
453454

454455
std::ostream request_stream(&m_request);
455456
request_stream.imbue(std::locale::classic());
456457

457-
request_stream << "CONNECT " << host << ":" << 443 << " HTTP/1.1" << CRLF;
458-
request_stream << "Host: " << host << ":" << 443 << CRLF;
458+
request_stream << "CONNECT " << host << ":" << ((port != 0) ? port : 443) << " HTTP/1.1" << CRLF;
459+
request_stream << "Host: " << host << ":" << ((port != 0) ? port : 443) << CRLF;
459460
request_stream << "Proxy-Connection: Keep-Alive" << CRLF;
460461

461462
if(m_context->m_http_client->client_config().proxy().credentials().is_set())

0 commit comments

Comments
 (0)