From 27579e4fae66f5ac1dc9bf399f15051d6db60480 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 5 Dec 2025 16:43:28 -0500 Subject: [PATCH] refactor: Move file open logic to SecureUtil where its used --- src/lib/net/SecureUtils.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/net/SecureUtils.cpp b/src/lib/net/SecureUtils.cpp index 319efd3fa..65aa74803 100644 --- a/src/lib/net/SecureUtils.cpp +++ b/src/lib/net/SecureUtils.cpp @@ -8,7 +8,6 @@ #include "SecureUtils.h" #include "base/FinalAction.h" -#include "io/Filesystem.h" #include #include @@ -16,6 +15,7 @@ #include #include +#include #include namespace deskflow { @@ -91,7 +91,13 @@ void generatePemSelfSignedCert(const QString &path, int keyLength) X509_sign(cert, privateKey, EVP_sha256()); - auto fp = fopenUtf8Path(path.toStdString().c_str(), "w"); + const std::filesystem::path fsPath = path.toStdString(); +#if SYSAPI_WIN32 + auto fp = _wfopen(fsPath.native().c_str(), L"w"); +#else + auto fp = std::fopen(fsPath.native().c_str(), "w"); +#endif + if (!fp) { throw std::runtime_error("could not open certificate output path"); }