SSL support for windows

This commit is contained in:
aMannus
2025-05-21 10:54:02 +02:00
parent dcfbcf8602
commit abc819626b
4 changed files with 3492 additions and 5 deletions

View File

@@ -82,7 +82,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(VCPKG_TARGET_TRIPLET x64-windows-static)
vcpkg_bootstrap()
vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net glew glfw3 nlohmann-json tinyxml2 spdlog)
vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net openssl glew glfw3 nlohmann-json tinyxml2 spdlog)
if (CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache|sccache")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)

View File

@@ -279,9 +279,6 @@ endif()
################################################################################
add_compile_definitions(ASIO_STANDALONE)
# TEMPORARY
add_compile_definitions(WSWRAP_NO_SSL)
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../subprojects/asio/include
${CMAKE_CURRENT_SOURCE_DIR}/../subprojects/websocketpp
@@ -305,6 +302,13 @@ if (BUILD_REMOTE_CONTROL)
else()
set(SDL2-NET-INCLUDE ${SDL_NET_INCLUDE_DIRS})
endif()
set(OPENSSL_USE_STATIC_LIBS TRUE)
find_package(OpenSSL)
if(NOT OPENSSL_FOUND)
message(STATUS "OpenSSL not found (it's possible the version installed is too old). Disabling BUILD_REMOTE_CONTROL.")
set(BUILD_REMOTE_CONTROL 0)
endif()
endif()
target_include_directories(${PROJECT_NAME} PRIVATE assets
@@ -638,6 +642,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
"SDL2::SDL2;"
"SDL2::SDL2main;"
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:SDL2_net::SDL2_net-static>"
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:OpenSSL::SSL>"
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:OpenSSL::Crypto>"
"glfw;"
"winmm;"
"imm32;"

View File

@@ -36,7 +36,8 @@ bool ArchipelagoClient::StartClient() {
}
apClient = std::unique_ptr<APClient>(
new APClient(uuid, AP_Client_consts::AP_GAME_NAME, CVarGetString(CVAR_REMOTE_ARCHIPELAGO("ServerAddress"), "localhost:38281")));
new APClient(uuid, AP_Client_consts::AP_GAME_NAME,
CVarGetString(CVAR_REMOTE_ARCHIPELAGO("ServerAddress"), "localhost:38281"), "cacert.pem"));
apClient->set_room_info_handler([&]() {
std::list<std::string> tags;

File diff suppressed because it is too large Load Diff