From 1fdf75039594a19b4918dad635aead18863f47b7 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Tue, 9 Jun 2015 20:23:56 +0200 Subject: [PATCH] Added: INI option to verify SSL cert --- Source/Core/Core/ConfigManager.cpp | 2 ++ Source/Core/Core/ConfigManager.h | 1 + Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index a473532ca9..97e9d9dd20 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -319,6 +319,7 @@ void SConfig::SaveNetworkSettings(IniFile& ini) network->Set("SSLDumpRead", m_SSLDumpRead); network->Set("SSLDumpWrite", m_SSLDumpWrite); + network->Set("SSLVerifyCert", m_SSLVerifyCert); } void SConfig::SaveAnalyticsSettings(IniFile& ini) @@ -618,6 +619,7 @@ void SConfig::LoadNetworkSettings(IniFile& ini) network->Get("SSLDumpRead", &m_SSLDumpRead, false); network->Get("SSLDumpWrite", &m_SSLDumpWrite, false); + network->Get("SSLVerifyCert", &m_SSLVerifyCert, false); } void SConfig::LoadAnalyticsSettings(IniFile& ini) diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h index 642758e00c..41f6cd90c3 100644 --- a/Source/Core/Core/ConfigManager.h +++ b/Source/Core/Core/ConfigManager.h @@ -276,6 +276,7 @@ struct SConfig : NonCopyable // Network settings bool m_SSLDumpRead; bool m_SSLDumpWrite; + bool m_SSLVerifyCert; SysConf* m_SYSCONF; diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp index bfd51243d3..77bdc08011 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp @@ -6,6 +6,7 @@ #include "Common/FileUtil.h" #include "Common/NandPaths.h" +#include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/IPC_HLE/WII_IPC_HLE_Device_net_ssl.h" #include "Core/IPC_HLE/WII_Socket.h" @@ -174,7 +175,10 @@ IPCCommandResult CWII_IPC_HLE_Device_net_ssl::IOCtlV(u32 _CommandAddress) mbedtls_ssl_set_session(&ssl->ctx, &ssl->session); - mbedtls_ssl_conf_authmode(&ssl->config, MBEDTLS_SSL_VERIFY_REQUIRED); + if (SConfig::GetInstance().m_SSLVerifyCert && verifyOption) + mbedtls_ssl_conf_authmode(&ssl->config, MBEDTLS_SSL_VERIFY_REQUIRED); + else + mbedtls_ssl_conf_authmode(&ssl->config, MBEDTLS_SSL_VERIFY_NONE); mbedtls_ssl_conf_renegotiation(&ssl->config, MBEDTLS_SSL_RENEGOTIATION_ENABLED); ssl->hostname = hostname;