diff --git a/src/lib/gui/TlsUtility.cpp b/src/lib/gui/TlsUtility.cpp index dd947c0ff..9729db220 100644 --- a/src/lib/gui/TlsUtility.cpp +++ b/src/lib/gui/TlsUtility.cpp @@ -115,7 +115,7 @@ bool generateCertificate() } try { - deskflow::generatePemSelfSignedCert(certPath.toStdString(), keyLength); + deskflow::generatePemSelfSignedCert(certPath, keyLength); } catch (const std::exception &e) { qCritical() << "failed to generate self-signed pem cert: " << e.what(); return false; diff --git a/src/lib/net/SecureUtils.cpp b/src/lib/net/SecureUtils.cpp index d2a515c32..319efd3fa 100644 --- a/src/lib/net/SecureUtils.cpp +++ b/src/lib/net/SecureUtils.cpp @@ -62,7 +62,7 @@ Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm t return {type, digestArray}; } -void generatePemSelfSignedCert(const std::string &path, int keyLength) +void generatePemSelfSignedCert(const QString &path, int keyLength) { auto expirationDays = 365; @@ -91,7 +91,7 @@ void generatePemSelfSignedCert(const std::string &path, int keyLength) X509_sign(cert, privateKey, EVP_sha256()); - auto fp = fopenUtf8Path(path.c_str(), "w"); + auto fp = fopenUtf8Path(path.toStdString().c_str(), "w"); if (!fp) { throw std::runtime_error("could not open certificate output path"); } diff --git a/src/lib/net/SecureUtils.h b/src/lib/net/SecureUtils.h index 3f1063c35..d8dc33f13 100644 --- a/src/lib/net/SecureUtils.h +++ b/src/lib/net/SecureUtils.h @@ -11,8 +11,6 @@ #include -#include - namespace deskflow { /** @@ -27,7 +25,7 @@ QString formatSSLFingerprintColumns(const QByteArray &fingerprint); Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm type); -void generatePemSelfSignedCert(const std::string &path, int keyLength = 2048); +void generatePemSelfSignedCert(const QString &path, int keyLength = 2048); QString generateFingerprintArt(const QByteArray &rawDigest); } // namespace deskflow