diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8242ccbe1..0212a5482 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -277,6 +277,7 @@ jobs: -DRUST_PATH="$HOME/.cargo/bin/" \ -DIMHEX_PATTERNS_PULL_MASTER=ON \ -DIMHEX_PLUGINS_IN_SHARE=ON \ + -DIMHEX_USE_BUNDLED_CA=ON \ .. make -j 4 install DESTDIR=AppDir diff --git a/CMakeLists.txt b/CMakeLists.txt index cc65f12d9..b8a5b529f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.20) # Options +option(IMHEX_USE_BUNDLED_CA "Use the CA bundle in romfs instead of the system one" OFF) option(IMHEX_PLUGINS_IN_SHARE "Put the plugins in share/imhex/plugins instead of lib[..]/imhex/plugins" OFF) option(IMHEX_STRIP_RELEASE "Strip the release builds" ON) option(IMHEX_OFFLINE_BUILD "Enable offline build" OFF) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 2dfa701c9..638f17a74 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -84,6 +84,8 @@ macro(detectOS) set(CMAKE_INSTALL_BINDIR ".") set(CMAKE_INSTALL_LIBDIR ".") set(PLUGINS_INSTALL_LOCATION "plugins") + + SET(IMHEX_USE_BUNDLED_CA ON) elseif (APPLE) add_compile_definitions(OS_MACOS) set(CMAKE_INSTALL_BINDIR ".") @@ -102,10 +104,15 @@ macro(detectOS) # Warning : Do not work with portable versions such as appimage (because the path is hardcoded) add_compile_definitions(SYSTEM_PLUGINS_LOCATION="${CMAKE_INSTALL_FULL_LIBDIR}/imhex") # "plugins" will be appended from the app endif() - + else () message(FATAL_ERROR "Unknown / unsupported system!") endif() + + if(IMHEX_USE_BUNDLED_CA) + add_compile_definitions(IMHEX_USE_BUNDLED_CA) + endif() + endmacro() # Detect 32 vs. 64 bit system diff --git a/lib/libimhex/source/helpers/net.cpp b/lib/libimhex/source/helpers/net.cpp index 9446996a1..b2c619ae1 100644 --- a/lib/libimhex/source/helpers/net.cpp +++ b/lib/libimhex/source/helpers/net.cpp @@ -109,7 +109,7 @@ namespace hex { curl_easy_setopt(this->m_ctx, CURLOPT_NOSIGNAL, 1L); curl_easy_setopt(this->m_ctx, CURLOPT_NOPROGRESS, 0L); -#if defined(OS_WINDOWS) +#if defined(IMHEX_USE_BUNDLED_CA) curl_easy_setopt(this->m_ctx, CURLOPT_CAINFO, nullptr); curl_easy_setopt(this->m_ctx, CURLOPT_CAPATH, nullptr); curl_easy_setopt(this->m_ctx, CURLOPT_SSLCERTTYPE, "PEM");