From 5a7db74c52d95f59e2972ed255407e75fd338ed8 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Fri, 14 May 2021 09:29:27 +0430 Subject: [PATCH] LibTLS: Actually verify the certificats This was likely commented out at some point to debug something. --- Userland/Libraries/LibTLS/ClientHandshake.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibTLS/ClientHandshake.cpp b/Userland/Libraries/LibTLS/ClientHandshake.cpp index 0b5288270c..c012df5bc7 100644 --- a/Userland/Libraries/LibTLS/ClientHandshake.cpp +++ b/Userland/Libraries/LibTLS/ClientHandshake.cpp @@ -259,8 +259,7 @@ void TLSv12::build_random(PacketBuilder& builder) m_context.premaster_key = ByteBuffer::copy(random_bytes, bytes); - // const auto& certificate_option = verify_chain_and_get_matching_certificate(m_context.extensions.SNI); // if the SNI is empty, we'll make a special case and match *a* leaf certificate. - Optional certificate_option = 0; + const auto& certificate_option = verify_chain_and_get_matching_certificate(m_context.extensions.SNI); // if the SNI is empty, we'll make a special case and match *a* leaf certificate. if (!certificate_option.has_value()) { dbgln("certificate verification failed :("); alert(AlertLevel::Critical, AlertDescription::BadCertificate);