Browse Source

bundled openSSL support

Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3308/head
crueter 3 weeks ago
parent
commit
57217d85a1
  1. 1
      src/core/CMakeLists.txt
  2. 17
      src/core/hle/service/bcat/news/builtin_news.cpp
  3. 6
      src/frontend_common/CMakeLists.txt
  4. 2
      src/qt_common/discord/discord_impl.cpp

1
src/core/CMakeLists.txt

@ -1212,7 +1212,6 @@ else()
endif()
target_link_libraries(core PRIVATE fmt::fmt nlohmann_json::nlohmann_json RenderDoc::API MbedTLS::mbedcrypto${MBEDTLS_LIB_SUFFIX} MbedTLS::mbedtls${MBEDTLS_LIB_SUFFIX})
target_link_libraries(core PRIVATE httplib::httplib)
if (ENABLE_WEB_SERVICE)

17
src/core/hle/service/bcat/news/builtin_news.cpp

@ -6,7 +6,6 @@
#include "core/hle/service/bcat/news/news_storage.h"
#include "common/fs/file.h"
#include "common/fs/fs.h"
#include "common/fs/path_util.h"
#include "common/logging/log.h"
@ -14,7 +13,6 @@
#include <httplib.h>
#include <nlohmann/json.hpp>
#include <algorithm>
#include <chrono>
#include <filesystem>
#include <fstream>
@ -23,6 +21,10 @@
#include <optional>
#include <sstream>
#ifdef YUZU_BUNDLED_OPENSSL
#include <openssl/cert.h>
#endif
namespace Service::News {
namespace {
@ -92,6 +94,10 @@ std::vector<u8> LoadLogo() {
cli.set_connection_timeout(std::chrono::seconds(10));
cli.set_read_timeout(std::chrono::seconds(30));
#ifdef YUZU_BUNDLED_OPENSSL
cli.load_ca_cert_store(kCert, sizeof(kCert));
#endif
if (auto res = cli.Get("/1OuqHlk.jpeg"); res && res->status == 200 && !res->body.empty()) {
g_logo_cache.assign(res->body.begin(), res->body.end());
@ -135,12 +141,19 @@ std::optional<std::string> DownloadReleasesJson() {
{"Accept", "application/vnd.github+json"},
};
// TODO(crueter): automate this in some way...
#ifdef YUZU_BUNDLED_OPENSSL
cli.load_ca_cert_store(kCert, sizeof(kCert));
#endif
if (auto res = cli.Get(GitHubAPI_EdenReleases, headers); res && res->status < 400) {
return res->body;
}
} catch (...) {
LOG_WARNING(Service_BCAT, " failed to download releases");
}
return std::nullopt;
}
// idk but News App does not render Markdown or HTML, so remove some formatting.

6
src/frontend_common/CMakeLists.txt

@ -12,16 +12,14 @@ add_library(frontend_common STATIC
firmware_manager.cpp
data_manager.h data_manager.cpp
play_time_manager.cpp
play_time_manager.h
)
play_time_manager.h)
if (ENABLE_UPDATE_CHECKER)
target_link_libraries(frontend_common PRIVATE httplib::httplib)
target_link_libraries(frontend_common PRIVATE nlohmann_json::nlohmann_json)
target_sources(frontend_common PRIVATE
update_checker.cpp
update_checker.h
)
update_checker.h)
if (ENABLE_OPENSSL)
target_compile_definitions(frontend_common PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)

2
src/qt_common/discord/discord_impl.cpp

@ -100,7 +100,7 @@ void DiscordImpl::Update() {
"https://raw.githubusercontent.com/eden-emulator/boxart/refs/heads/master/img/{}.png",
icon_name);
httplib::SSLClient client(game_url);
httplib::Client client(game_url);
client.set_connection_timeout(3);
client.set_read_timeout(3);
client.set_follow_location(true);

Loading…
Cancel
Save