Skip to content

Commit 7cb3478

Browse files
committed
Update Boost library version to 1.87
1 parent 7aac899 commit 7cb3478

8 files changed

+23
-23
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ endif(BUILD_TESTS)
9292
set(Boost_USE_STATIC_LIBS ON)
9393
set(Boost_USE_DEBUG_RUNTIME OFF)
9494
#set_property(GLOBAL PROPERTY Boost_USE_MULTITHREADED ON)
95-
set(BOOST_PKG_VERSION "1.81.0" CACHE STRING "")
95+
set(BOOST_PKG_VERSION "1.87.0" CACHE STRING "")
9696
find_package(Boost ${BOOST_PKG_VERSION} REQUIRED COMPONENTS system log log_setup thread program_options date_time filesystem chrono)
9797
include_directories(${Boost_INCLUDE_DIRS})
9898
foreach(BOOST_LIB ${Boost_LIBRARIES})

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ and you can add ` -p <port_number>` to expose a port from the docker container.
112112
* C++ 14 compiler
113113
* CMake 3.6+
114114
* Development libraries required:
115-
* Boost 1.81
115+
* Boost 1.87
116116
* Protobuf 3.17.x
117117
* zlib 1.12.13+
118118
* OpenSSL 1.0+ OR OpenSSL 3
@@ -141,9 +141,9 @@ Fedora example:
141141

142142
#### 2. Download and install Boost dependency
143143

144-
wget https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.gz -O /tmp/boost.tar.gz
145-
tar xzvf /tmp/boost.tar.gz
146-
cd boost_1_81_0
144+
wget https://sourceforge.net/projects/boost/files/boost/1.87.0/boost_1_87_0.tar.gz/download -O /tmp/boost_1_87_0.tar.gz
145+
tar xzvf /tmp/boost_1_87_0.tar.gz
146+
cd boost_1_87_0
147147
./bootstrap.sh
148148
sudo ./b2 install link=static
149149

src/LocalproxyConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <boost/beast/websocket.hpp>
1818
#include <boost/beast/websocket/ssl.hpp>
1919
#include <boost/asio.hpp>
20-
#include <boost/asio/ssl/rfc2818_verification.hpp>
20+
#include <boost/asio/ssl/host_name_verification.hpp>
2121
#include <boost/asio/ip/tcp.hpp>
2222
#include <boost/format.hpp>
2323
#include <boost/property_tree/ptree.hpp>

src/TcpAdapterProxy.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <boost/algorithm/string.hpp>
77
#include <boost/lexical_cast.hpp>
88
#include <boost/asio.hpp>
9-
#include <boost/asio/ssl/rfc2818_verification.hpp>
9+
#include <boost/asio/ssl/host_name_verification.hpp>
1010
#include <boost/beast/websocket.hpp>
1111
#include <boost/beast/core/flat_buffer.hpp>
1212
#include <boost/endian/conversion.hpp>
@@ -923,7 +923,7 @@ namespace aws { namespace iot { namespace securedtunneling {
923923
if (!localproxy_config.no_ssl_host_verify)
924924
{
925925
tac.wss->set_ssl_verify_mode(boost::asio::ssl::verify_peer | boost::asio::ssl::verify_fail_if_no_peer_cert);
926-
tac.wss->set_verify_callback(boost::asio::ssl::rfc2818_verification(tac.adapter_config.proxy_host));
926+
tac.wss->set_verify_callback(boost::asio::ssl::host_name_verification(tac.adapter_config.proxy_host));
927927
}
928928
else
929929
{
@@ -974,7 +974,7 @@ namespace aws { namespace iot { namespace securedtunneling {
974974
}
975975
else
976976
{
977-
BOOST_LOG_SEV(log, debug) << "Resolved proxy server IP: " << results->endpoint().address();
977+
BOOST_LOG_SEV(log, debug) << "Resolved proxy server IP: " << results.begin()->endpoint().address();
978978
//next connect tcp
979979
tac.wss->lowest_layer().async_connect(*results.begin(), on_tcp_connect);
980980
}
@@ -986,8 +986,8 @@ namespace aws { namespace iot { namespace securedtunneling {
986986
BOOST_LOG_SEV(log, error) << (boost::format("Could not resolve DNS hostname of Web proxy: %1% - %2%") % tac.adapter_config.web_proxy_host % ec.message()).str();
987987
basic_retry_execute(log, retry_config, [&]() { std::bind(&tcp_adapter_proxy::web_socket_close_and_stop, this, std::ref(tac)); });
988988
} else {
989-
BOOST_LOG_SEV(log, debug) << "Resolved Web proxy IP: " << results->endpoint().address();
990-
web_proxy_adapter.async_connect(on_tcp_connect, tac.wss, results->endpoint());
989+
BOOST_LOG_SEV(log, debug) << "Resolved Web proxy IP: " << results.begin()->endpoint().address();
990+
web_proxy_adapter.async_connect(on_tcp_connect, tac.wss, results.begin()->endpoint());
991991
}
992992
};
993993

@@ -1935,17 +1935,17 @@ namespace aws { namespace iot { namespace securedtunneling {
19351935
}
19361936
else
19371937
{
1938-
BOOST_LOG_SEV(log, debug) << "Resolved bind IP: " << results->endpoint().address().to_string();
1938+
BOOST_LOG_SEV(log, debug) << "Resolved bind IP: " << results.begin()->endpoint().address().to_string();
19391939
boost::system::error_code bind_ec;
1940-
server->acceptor_.open(results->endpoint().protocol());
1940+
server->acceptor_.open(results.begin()->endpoint().protocol());
19411941
if (port_to_connect)
19421942
{ //if data port is 0 (means pick an empheral port), then don't set this option
19431943
server->acceptor_.set_option(reuse_addr_option);
19441944
}
1945-
server->acceptor_.bind(results->endpoint(), bind_ec);
1945+
server->acceptor_.bind(results.begin()->endpoint(), bind_ec);
19461946
if (bind_ec)
19471947
{
1948-
BOOST_LOG_SEV(log, error) << (boost::format("Could not bind to address: %1%:%2% -- %3%") % results->endpoint().address().to_string() % results->endpoint().port() % bind_ec.message()).str();
1948+
BOOST_LOG_SEV(log, error) << (boost::format("Could not bind to address: %1%:%2% -- %3%") % results.begin()->endpoint().address().to_string() % results.begin()->endpoint().port() % bind_ec.message()).str();
19491949
basic_retry_execute(log, retry_config,
19501950
[]() { throw proxy_exception(SOURCE_LOCAL_PROXY_PORT_BIND_EXCEPTION); });
19511951
}
@@ -1958,7 +1958,7 @@ namespace aws { namespace iot { namespace securedtunneling {
19581958
if (listen_ec)
19591959
{
19601960
BOOST_LOG_SEV(log, error) << (boost::format("Could not listen on bind address: %1%:%2% -- %3%")
1961-
% results->endpoint().address().to_string() % local_port % listen_ec.message()).str();
1961+
% results.begin()->endpoint().address().to_string() % local_port % listen_ec.message()).str();
19621962
basic_retry_execute(log, retry_config,
19631963
[]() { throw proxy_exception(SOURCE_LOCAL_PROXY_PORT_BIND_EXCEPTION); });
19641964
}
@@ -2057,8 +2057,8 @@ namespace aws { namespace iot { namespace securedtunneling {
20572057
}
20582058
else {
20592059
tcp_client::pointer client = tac.serviceId_to_tcp_client_map[service_id];
2060-
std::string dst_host = results->endpoint().address().to_string();
2061-
unsigned short dst_port = results->endpoint().port();
2060+
std::string dst_host = results.begin()->endpoint().address().to_string();
2061+
unsigned short dst_port = results.begin()->endpoint().port();
20622062
BOOST_LOG_SEV(log, debug) << "Resolved destination host to IP: " << dst_host << ", connecting ...";
20632063

20642064
boost::system::error_code connect_ec;
@@ -2137,7 +2137,7 @@ namespace aws { namespace iot { namespace securedtunneling {
21372137
}
21382138
else
21392139
{
2140-
BOOST_LOG_SEV(log, debug) << "Resolved bind IP: " << results->endpoint().address().to_string();
2140+
BOOST_LOG_SEV(log, debug) << "Resolved bind IP: " << results.begin()->endpoint().address().to_string();
21412141

21422142
tuple<string, string> endpoint_to_connect = tcp_adapter_proxy::get_host_and_port(endpoint, tac.adapter_config.bind_address.get());
21432143
std::string dst_host = std::get<0>(endpoint_to_connect);

src/TcpAdapterProxy.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <boost/beast/websocket.hpp>
1717
#include <boost/beast/websocket/ssl.hpp>
1818
#include <boost/asio.hpp>
19-
#include <boost/asio/ssl/rfc2818_verification.hpp>
19+
#include <boost/asio/ssl/host_name_verification.hpp>
2020
#include <boost/asio/ip/tcp.hpp>
2121
#include <boost/format.hpp>
2222
#include <boost/property_tree/ptree.hpp>

src/WebProxyAdapter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace aws {
5252
void WebProxyAdapter::async_ssl_handshake() {
5353
if (!localproxy_config.no_ssl_host_verify) {
5454
websocket_stream->get_web_proxy_ssl_stream()->set_verify_mode(ssl::verify_peer | ssl::verify_fail_if_no_peer_cert);
55-
websocket_stream->get_web_proxy_ssl_stream()->set_verify_callback(boost::asio::ssl::rfc2818_verification(localproxy_config.web_proxy_host));
55+
websocket_stream->get_web_proxy_ssl_stream()->set_verify_callback(boost::asio::ssl::host_name_verification(localproxy_config.web_proxy_host));
5656
}
5757
websocket_stream->get_web_proxy_ssl_stream()->async_handshake(ssl::stream_base::client, [this](error_code const &ec) {
5858
if (ec) {

src/WebSocketStream.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ namespace aws {
163163
}
164164
}
165165

166-
void WebSocketStream::set_verify_callback(const ssl::rfc2818_verification &callback) {
166+
void WebSocketStream::set_verify_callback(const ssl::host_name_verification &callback) {
167167
if (localproxyConfig.is_web_proxy_using_tls) {
168168
BOOST_LOG_SEV(*log, trace) << "Calling set_verify_callback with type: double_ssl_stream";
169169
return double_ssl_stream->set_verify_callback(callback);

src/WebSocketStream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace aws {
142142
* proxy server and the localproxy.
143143
* @param callback the SSL callback.
144144
*/
145-
void set_verify_callback(const ssl::rfc2818_verification &callback);
145+
void set_verify_callback(const ssl::host_name_verification &callback);
146146

147147
/**
148148
* Performs the SSL handshake between the localproxy and the proxy server asynchronously.

0 commit comments

Comments
 (0)