From 82d932a503ef133852a70aea53fe2d19797a96e0 Mon Sep 17 00:00:00 2001 From: Lev Stipakov Date: Mon, 23 Aug 2021 16:00:56 +0300 Subject: [PATCH] URL profile import: disable profile download in case of certificate errors Allow users to bypass HTTPS is not good, but may nevertheless be useful during development. DEBUG macro is widely used in openvpn-gui code but was missing from CMakeLists.txt, so add it there. Signed-off-by: Lev Stipakov --- CMakeLists.txt | 2 ++ as.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1751ec2..75705fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,8 @@ add_executable(${PROJECT_NAME} WIN32 find_package(OpenSSL REQUIRED) +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") + target_link_libraries(${PROJECT_NAME} OpenSSL::SSL Wtsapi32.lib diff --git a/as.c b/as.c index 0612fcd..eac771b 100644 --- a/as.c +++ b/as.c @@ -336,6 +336,7 @@ again: /* handle cert errors */ /* https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/182888 */ if (!HttpSendRequestW(hRequest, NULL, 0, NULL, 0)) { +#ifdef DEBUG DWORD err = GetLastError(); if ((err == ERROR_INTERNET_INVALID_CA) || (err == ERROR_INTERNET_SEC_CERT_CN_INVALID) || @@ -369,7 +370,7 @@ again: else goto done; } - +#endif ShowWinInetError(hWnd); goto done; }