Skip to content

Commit 9b0930a

Browse files
committed
Update ssl_delegate.ipp
1 parent c5aca73 commit 9b0930a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

boost/network/protocol/http/client/connection/ssl_delegate.ipp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ boost::network::http::impl::ssl_delegate::ssl_delegate(
2929
always_verify_peer_(always_verify_peer) {}
3030

3131
void boost::network::http::impl::ssl_delegate::connect(
32-
asio::ip::tcp::endpoint &endpoint, std::string host,
32+
asio::ip::tcp::endpoint &endpoint, std::string host, boost::uint16_t source_port,
3333
function<void(system::error_code const &)> handler) {
3434
context_.reset(
3535
new asio::ssl::context(service_, asio::ssl::context::sslv23_client));
@@ -59,8 +59,11 @@ void boost::network::http::impl::ssl_delegate::connect(
5959
if (private_key_file_)
6060
context_->use_private_key_file(*private_key_file_,
6161
boost::asio::ssl::context::pem);
62+
63+
tcp_socket_.reset(new asio::ip::tcp::socket(service_, asio::ip::tcp::endpoint(asio::ip::tcp::v4(), source_port)));
6264
socket_.reset(
63-
new asio::ssl::stream<asio::ip::tcp::socket>(service_, *context_));
65+
new asio::ssl::stream<asio::ip::tcp::socket&>(*(tcp_socket_.get()), *context_));
66+
6467
if (always_verify_peer_)
6568
socket_->set_verify_callback(boost::asio::ssl::rfc2818_verification(host));
6669
socket_->lowest_layer().async_connect(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy