mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
sys: Make sure libromfs is never used in libimhex
This commit is contained in:
@@ -9,11 +9,8 @@
|
||||
#include <filesystem>
|
||||
#include <cstdio>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <romfs/romfs.hpp>
|
||||
|
||||
namespace hex {
|
||||
|
||||
Net::Net() {
|
||||
@@ -45,7 +42,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
static CURLcode sslCtxFunction(CURL *ctx, void *sslctx, void *userData) {
|
||||
CURLcode sslCtxFunction(CURL *ctx, void *sslctx, void *userData) {
|
||||
hex::unused(ctx, userData);
|
||||
|
||||
auto *cfg = static_cast<mbedtls_ssl_config *>(sslctx);
|
||||
@@ -53,8 +50,7 @@ namespace hex {
|
||||
auto crt = static_cast<mbedtls_x509_crt*>(userData);
|
||||
mbedtls_x509_crt_init(crt);
|
||||
|
||||
auto cacert = romfs::get("cacert.pem").string();
|
||||
mbedtls_x509_crt_parse(crt, reinterpret_cast<const u8 *>(cacert.data()), cacert.size());
|
||||
mbedtls_x509_crt_parse(crt, reinterpret_cast<const u8 *>(Net::s_caCert.data()), Net::s_caCert.size());
|
||||
|
||||
mbedtls_ssl_conf_ca_chain(cfg, crt, nullptr);
|
||||
|
||||
@@ -296,9 +292,13 @@ namespace hex {
|
||||
}
|
||||
|
||||
std::string Net::s_proxyUrl;
|
||||
|
||||
void Net::setProxy(const std::string &url) {
|
||||
Net::s_proxyUrl = url;
|
||||
}
|
||||
|
||||
std::string Net::s_caCert;
|
||||
void Net::setCACert(const std::string &content) {
|
||||
Net::s_caCert = content;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user