Enable hostname verification in UnbufferedAsioTlsStream

This commit is contained in:
Julian Brost 2021-08-13 09:28:57 +02:00
parent 852d674ec0
commit 396f003c69
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,10 @@ void UnbufferedAsioTlsStream::BeforeHandshake(handshake_type type)
{
namespace ssl = boost::asio::ssl;
if (!m_Hostname.IsEmpty()) {
X509_VERIFY_PARAM_set1_host(SSL_get0_param(native_handle()), m_Hostname.CStr(), m_Hostname.GetLength());
}
set_verify_mode(ssl::verify_peer | ssl::verify_client_once);
set_verify_callback([this](bool preverified, ssl::verify_context& ctx) {