Skip to content

Commit

Permalink
Fix build with boost < 1.73
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg committed Feb 23, 2021
1 parent 1cf2090 commit 64175d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/network_asio.cpp
Expand Up @@ -167,7 +167,11 @@ void connection::handle_handshake(const boost::system::error_code& ec)
boost::asio::ssl::verify_fail_if_no_peer_cert
);

#if BOOST_VERSION >= 107300
socket.set_verify_callback(boost::asio::ssl::host_name_verification(host_));
#else
socket.set_verify_callback(boost::asio::ssl::rfc2818_verification(host_));
#endif

socket.async_handshake(boost::asio::ssl::stream_base::client, [this](const boost::system::error_code& ec) {
if(ec) {
Expand Down
5 changes: 4 additions & 1 deletion src/wesnothd_connection.cpp
Expand Up @@ -23,7 +23,6 @@
#include <boost/asio/connect.hpp>
#include <boost/asio/read.hpp>
#include <boost/asio/write.hpp>
#include <boost/asio/ssl/host_name_verification.hpp>

#include <cstdint>
#include <deque>
Expand Down Expand Up @@ -207,7 +206,11 @@ void wesnothd_connection::handle_handshake(const error_code& ec)
boost::asio::ssl::verify_fail_if_no_peer_cert
);

#if BOOST_VERSION >= 107300
socket.set_verify_callback(boost::asio::ssl::host_name_verification(host_));
#else
socket.set_verify_callback(boost::asio::ssl::rfc2818_verification(host_));
#endif

socket.async_handshake(boost::asio::ssl::stream_base::client, [this](const error_code& ec) {
if(ec) {
Expand Down

0 comments on commit 64175d3

Please sign in to comment.