6
6
#include < boost/algorithm/string.hpp>
7
7
#include < boost/lexical_cast.hpp>
8
8
#include < boost/asio.hpp>
9
- #include < boost/asio/ssl/rfc2818_verification .hpp>
9
+ #include < boost/asio/ssl/host_name_verification .hpp>
10
10
#include < boost/beast/websocket.hpp>
11
11
#include < boost/beast/core/flat_buffer.hpp>
12
12
#include < boost/endian/conversion.hpp>
@@ -923,7 +923,7 @@ namespace aws { namespace iot { namespace securedtunneling {
923
923
if (!localproxy_config.no_ssl_host_verify )
924
924
{
925
925
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 ));
927
927
}
928
928
else
929
929
{
@@ -974,7 +974,7 @@ namespace aws { namespace iot { namespace securedtunneling {
974
974
}
975
975
else
976
976
{
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 ();
978
978
// next connect tcp
979
979
tac.wss ->lowest_layer ().async_connect (*results.begin (), on_tcp_connect);
980
980
}
@@ -986,8 +986,8 @@ namespace aws { namespace iot { namespace securedtunneling {
986
986
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 ();
987
987
basic_retry_execute (log , retry_config, [&]() { std::bind (&tcp_adapter_proxy::web_socket_close_and_stop, this , std::ref (tac)); });
988
988
} 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 ());
991
991
}
992
992
};
993
993
@@ -1935,17 +1935,17 @@ namespace aws { namespace iot { namespace securedtunneling {
1935
1935
}
1936
1936
else
1937
1937
{
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 ();
1939
1939
boost::system ::error_code bind_ec;
1940
- server->acceptor_ .open (results->endpoint ().protocol ());
1940
+ server->acceptor_ .open (results. begin () ->endpoint ().protocol ());
1941
1941
if (port_to_connect)
1942
1942
{ // if data port is 0 (means pick an empheral port), then don't set this option
1943
1943
server->acceptor_ .set_option (reuse_addr_option);
1944
1944
}
1945
- server->acceptor_ .bind (results->endpoint (), bind_ec);
1945
+ server->acceptor_ .bind (results. begin () ->endpoint (), bind_ec);
1946
1946
if (bind_ec)
1947
1947
{
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 ();
1949
1949
basic_retry_execute (log , retry_config,
1950
1950
[]() { throw proxy_exception (SOURCE_LOCAL_PROXY_PORT_BIND_EXCEPTION); });
1951
1951
}
@@ -1958,7 +1958,7 @@ namespace aws { namespace iot { namespace securedtunneling {
1958
1958
if (listen_ec)
1959
1959
{
1960
1960
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 ();
1962
1962
basic_retry_execute (log , retry_config,
1963
1963
[]() { throw proxy_exception (SOURCE_LOCAL_PROXY_PORT_BIND_EXCEPTION); });
1964
1964
}
@@ -2057,8 +2057,8 @@ namespace aws { namespace iot { namespace securedtunneling {
2057
2057
}
2058
2058
else {
2059
2059
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 ();
2062
2062
BOOST_LOG_SEV (log , debug) << " Resolved destination host to IP: " << dst_host << " , connecting ..." ;
2063
2063
2064
2064
boost::system ::error_code connect_ec;
@@ -2137,7 +2137,7 @@ namespace aws { namespace iot { namespace securedtunneling {
2137
2137
}
2138
2138
else
2139
2139
{
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 ();
2141
2141
2142
2142
tuple<string, string> endpoint_to_connect = tcp_adapter_proxy::get_host_and_port (endpoint, tac.adapter_config .bind_address .get ());
2143
2143
std::string dst_host = std::get<0 >(endpoint_to_connect);
0 commit comments