Enable hostname verification in UnbufferedAsioTlsStream

This commit is contained in:
Julian Brost 2021-08-13 09:28:57 +02:00 committed by Noah Hilverling
parent 86ae1b09b7
commit 6080538223

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) {