Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Boost library version to 1.87 #175

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
- name: Install boost
working-directory: ${{ github.workspace }}
run: |
wget https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.gz -O /tmp/boost.tar.gz
tar xzvf /tmp/boost.tar.gz
cd boost_1_84_0
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
tar xzvf /tmp/boost_1_87_0.tar.gz
cd boost_1_87_0
./bootstrap.sh --with-toolset=clang
sudo ./b2 install toolset=clang link=static
- name: Install protobuf
Expand Down Expand Up @@ -75,9 +75,9 @@ jobs:
- name: Install boost
working-directory: ${{ github.workspace }}
run: |
wget https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.gz -O /tmp/boost.tar.gz
tar xzvf /tmp/boost.tar.gz
cd boost_1_84_0
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
tar xzvf /tmp/boost_1_87_0.tar.gz
cd boost_1_87_0
./bootstrap.sh
sudo ./b2 install link=static
- name: Install protobuf
Expand Down Expand Up @@ -155,9 +155,9 @@ jobs:
$env:Path += ";C:\Program Files (x86)\zlib\bin"
- name: Install boost
run: |
Invoke-WebRequest "https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.zip" -OutFile "boost_1_84_0.zip"
Expand-Archive "boost_1_84_0.zip" -Force
cd .\boost_1_84_0\boost_1_84_0\
Invoke-WebRequest "https://sourceforge.net/projects/boost/files/boost/1.87.0/boost_1_87_0.zip/download" -OutFile "boost_1_87_0.zip"
Expand-Archive "boost_1_87_0.zip" -Force
cd .\boost_1_87_0\
.\bootstrap.bat
.\b2 toolset=msvc-14.2 address-model=64 install define=_WIN32_WINNT=0x0601 define=BOOST_WINAPI_VERSION_WIN7 link=static
- name: Install protobuf
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ endif(BUILD_TESTS)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_DEBUG_RUNTIME OFF)
#set_property(GLOBAL PROPERTY Boost_USE_MULTITHREADED ON)
set(BOOST_PKG_VERSION "1.81.0" CACHE STRING "")
set(BOOST_PKG_VERSION "1.87.0" CACHE STRING "")
find_package(Boost ${BOOST_PKG_VERSION} REQUIRED COMPONENTS system log log_setup thread program_options date_time filesystem chrono)
include_directories(${Boost_INCLUDE_DIRS})
foreach(BOOST_LIB ${Boost_LIBRARIES})
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ and you can add ` -p <port_number>` to expose a port from the docker container.
* C++ 14 compiler
* CMake 3.6+
* Development libraries required:
* Boost 1.81
* Boost 1.87
* Protobuf 3.17.x
* zlib 1.12.13+
* OpenSSL 1.0+ OR OpenSSL 3
Expand Down Expand Up @@ -141,9 +141,9 @@ Fedora example:

#### 2. Download and install Boost dependency

wget https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.gz -O /tmp/boost.tar.gz
tar xzvf /tmp/boost.tar.gz
cd boost_1_81_0
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
tar xzvf /tmp/boost_1_87_0.tar.gz
cd boost_1_87_0
./bootstrap.sh
sudo ./b2 install link=static

Expand Down
2 changes: 1 addition & 1 deletion src/LocalproxyConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <boost/beast/websocket.hpp>
#include <boost/beast/websocket/ssl.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ssl/rfc2818_verification.hpp>
#include <boost/asio/ssl/host_name_verification.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/format.hpp>
#include <boost/property_tree/ptree.hpp>
Expand Down
26 changes: 13 additions & 13 deletions src/TcpAdapterProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ssl/rfc2818_verification.hpp>
#include <boost/asio/ssl/host_name_verification.hpp>
#include <boost/beast/websocket.hpp>
#include <boost/beast/core/flat_buffer.hpp>
#include <boost/endian/conversion.hpp>
Expand Down Expand Up @@ -923,7 +923,7 @@ namespace aws { namespace iot { namespace securedtunneling {
if (!localproxy_config.no_ssl_host_verify)
{
tac.wss->set_ssl_verify_mode(boost::asio::ssl::verify_peer | boost::asio::ssl::verify_fail_if_no_peer_cert);
tac.wss->set_verify_callback(boost::asio::ssl::rfc2818_verification(tac.adapter_config.proxy_host));
tac.wss->set_verify_callback(boost::asio::ssl::host_name_verification(tac.adapter_config.proxy_host));
}
else
{
Expand Down Expand Up @@ -974,7 +974,7 @@ namespace aws { namespace iot { namespace securedtunneling {
}
else
{
BOOST_LOG_SEV(log, debug) << "Resolved proxy server IP: " << results->endpoint().address();
BOOST_LOG_SEV(log, debug) << "Resolved proxy server IP: " << results.begin()->endpoint().address();
//next connect tcp
tac.wss->lowest_layer().async_connect(*results.begin(), on_tcp_connect);
}
Expand All @@ -986,8 +986,8 @@ namespace aws { namespace iot { namespace securedtunneling {
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();
basic_retry_execute(log, retry_config, [&]() { std::bind(&tcp_adapter_proxy::web_socket_close_and_stop, this, std::ref(tac)); });
} else {
BOOST_LOG_SEV(log, debug) << "Resolved Web proxy IP: " << results->endpoint().address();
web_proxy_adapter.async_connect(on_tcp_connect, tac.wss, results->endpoint());
BOOST_LOG_SEV(log, debug) << "Resolved Web proxy IP: " << results.begin()->endpoint().address();
web_proxy_adapter.async_connect(on_tcp_connect, tac.wss, results.begin()->endpoint());
}
};

Expand Down Expand Up @@ -1935,17 +1935,17 @@ namespace aws { namespace iot { namespace securedtunneling {
}
else
{
BOOST_LOG_SEV(log, debug) << "Resolved bind IP: " << results->endpoint().address().to_string();
BOOST_LOG_SEV(log, debug) << "Resolved bind IP: " << results.begin()->endpoint().address().to_string();
boost::system::error_code bind_ec;
server->acceptor_.open(results->endpoint().protocol());
server->acceptor_.open(results.begin()->endpoint().protocol());
if (port_to_connect)
{ //if data port is 0 (means pick an empheral port), then don't set this option
server->acceptor_.set_option(reuse_addr_option);
}
server->acceptor_.bind(results->endpoint(), bind_ec);
server->acceptor_.bind(results.begin()->endpoint(), bind_ec);
if (bind_ec)
{
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();
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();
basic_retry_execute(log, retry_config,
[]() { throw proxy_exception(SOURCE_LOCAL_PROXY_PORT_BIND_EXCEPTION); });
}
Expand All @@ -1958,7 +1958,7 @@ namespace aws { namespace iot { namespace securedtunneling {
if (listen_ec)
{
BOOST_LOG_SEV(log, error) << (boost::format("Could not listen on bind address: %1%:%2% -- %3%")
% results->endpoint().address().to_string() % local_port % listen_ec.message()).str();
% results.begin()->endpoint().address().to_string() % local_port % listen_ec.message()).str();
basic_retry_execute(log, retry_config,
[]() { throw proxy_exception(SOURCE_LOCAL_PROXY_PORT_BIND_EXCEPTION); });
}
Expand Down Expand Up @@ -2057,8 +2057,8 @@ namespace aws { namespace iot { namespace securedtunneling {
}
else {
tcp_client::pointer client = tac.serviceId_to_tcp_client_map[service_id];
std::string dst_host = results->endpoint().address().to_string();
unsigned short dst_port = results->endpoint().port();
std::string dst_host = results.begin()->endpoint().address().to_string();
unsigned short dst_port = results.begin()->endpoint().port();
BOOST_LOG_SEV(log, debug) << "Resolved destination host to IP: " << dst_host << ", connecting ...";

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

tuple<string, string> endpoint_to_connect = tcp_adapter_proxy::get_host_and_port(endpoint, tac.adapter_config.bind_address.get());
std::string dst_host = std::get<0>(endpoint_to_connect);
Expand Down
2 changes: 1 addition & 1 deletion src/TcpAdapterProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <boost/beast/websocket.hpp>
#include <boost/beast/websocket/ssl.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ssl/rfc2818_verification.hpp>
#include <boost/asio/ssl/host_name_verification.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/format.hpp>
#include <boost/property_tree/ptree.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/WebProxyAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace aws {
void WebProxyAdapter::async_ssl_handshake() {
if (!localproxy_config.no_ssl_host_verify) {
websocket_stream->get_web_proxy_ssl_stream()->set_verify_mode(ssl::verify_peer | ssl::verify_fail_if_no_peer_cert);
websocket_stream->get_web_proxy_ssl_stream()->set_verify_callback(boost::asio::ssl::rfc2818_verification(localproxy_config.web_proxy_host));
websocket_stream->get_web_proxy_ssl_stream()->set_verify_callback(boost::asio::ssl::host_name_verification(localproxy_config.web_proxy_host));
}
websocket_stream->get_web_proxy_ssl_stream()->async_handshake(ssl::stream_base::client, [this](error_code const &ec) {
if (ec) {
Expand Down
2 changes: 1 addition & 1 deletion src/WebSocketStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ namespace aws {
}
}

void WebSocketStream::set_verify_callback(const ssl::rfc2818_verification &callback) {
void WebSocketStream::set_verify_callback(const ssl::host_name_verification &callback) {
if (localproxyConfig.is_web_proxy_using_tls) {
BOOST_LOG_SEV(*log, trace) << "Calling set_verify_callback with type: double_ssl_stream";
return double_ssl_stream->set_verify_callback(callback);
Expand Down
2 changes: 1 addition & 1 deletion src/WebSocketStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ namespace aws {
* proxy server and the localproxy.
* @param callback the SSL callback.
*/
void set_verify_callback(const ssl::rfc2818_verification &callback);
void set_verify_callback(const ssl::host_name_verification &callback);

/**
* Performs the SSL handshake between the localproxy and the proxy server asynchronously.
Expand Down
Loading