forked from boostorg/beast
Replace SSL_set1_host with asio::ssl::host_name_verification
`SSL_set1_host` fails when host is an IP address
This commit is contained in:
1 parent
ea38d841b0
commit
ee2b5b2ff9
9 files changed
+34
-74
No files matched your search
@@ -66,12 +66,7 @@ do_session(
|
||||
}
|
||||
|
||||
// Set the expected hostname in the peer certificate for verification
|
||||
if(! SSL_set1_host(stream.native_handle(), host.c_str()))
|
||||
{
|
||||
ec.assign(static_cast<int>(::ERR_get_error()), net::error::get_ssl_category());
|
||||
std::cerr << ec.message() << "\n";
|
||||
return;
|
||||
}
|
||||
stream.set_verify_callback(ssl::host_name_verification(host));
|
||||
|
||||
// Look up the domain name
|
||||
auto const results = resolver.async_resolve(host, port, yield[ec]);
|
||||
|
||||
Reference in new issue
Block a user