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);
0 commit comments