diff --git a/src/main.cpp b/src/main.cpp index 2c4da4c1f..cb7cb18f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -53,6 +53,13 @@ int main(int argc, char** argv) { QT_REQUIRE_VERSION(argc, argv, QT_VERSION_STR) +#ifdef Q_OS_WIN + // Set OPENSSL_CONF and OPENSSL_MODULES to an invalid location to prevent DLL injection via openssl.cnf. + // vcpkg by default hard-codes this to its packages location, which may be user-writable. + qputenv("OPENSSL_CONF", "::"); + qputenv("OPENSSL_MODULES", "::"); +#endif + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) && defined(Q_OS_WIN)