diff --git a/src/mangosd/Main.cpp b/src/mangosd/Main.cpp index b929035b77..639d78bce3 100644 --- a/src/mangosd/Main.cpp +++ b/src/mangosd/Main.cpp @@ -33,9 +33,11 @@ #include #include #include +#include #include #include +#include #include #include @@ -179,16 +181,20 @@ int main(int argc, char* argv[]) DETAIL_LOG("%s (Library: %s)", OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION)); // Load OpenSSL 3.0+ providers +#ifdef _WIN32 + // For bundled OpenSSL library + OSSL_PROVIDER_set_default_search_path(nullptr, boost::filesystem::current_path().string().c_str()); +#endif OSSL_PROVIDER* openssl_legacy = OSSL_PROVIDER_load(nullptr, "legacy"); if (!openssl_legacy) { - sLog.outError("OpenSSL3: Failed to load Legacy provider"); + sLog.outError("OpenSSL3: Failed to load Legacy provider: %s", ERR_error_string(ERR_get_error(), NULL)); return 1; } OSSL_PROVIDER* openssl_default = OSSL_PROVIDER_load(nullptr, "default"); if (!openssl_default) { - sLog.outError("OpenSSL3: Failed to load Default provider"); + sLog.outError("OpenSSL3: Failed to load Default provider: %s", ERR_error_string(ERR_get_error(), NULL)); OSSL_PROVIDER_unload(openssl_legacy); return 1; } diff --git a/src/realmd/Main.cpp b/src/realmd/Main.cpp index 1fe6f30750..5a200d2ffa 100644 --- a/src/realmd/Main.cpp +++ b/src/realmd/Main.cpp @@ -36,10 +36,12 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -177,16 +179,20 @@ int main(int argc, char* argv[]) DETAIL_LOG("%s (Library: %s)", OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION)); // Load OpenSSL 3.0+ providers +#ifdef _WIN32 + // For bundled OpenSSL library + OSSL_PROVIDER_set_default_search_path(nullptr, boost::filesystem::current_path().string().c_str()); +#endif OSSL_PROVIDER* openssl_legacy = OSSL_PROVIDER_load(nullptr, "legacy"); if (!openssl_legacy) { - sLog.outError("OpenSSL3: Failed to load Legacy provider"); + sLog.outError("OpenSSL3: Failed to load Legacy provider: %s", ERR_error_string(ERR_get_error(), NULL)); return 1; } OSSL_PROVIDER* openssl_default = OSSL_PROVIDER_load(nullptr, "default"); if (!openssl_default) { - sLog.outError("OpenSSL3: Failed to load Default provider"); + sLog.outError("OpenSSL3: Failed to load Default provider: %s", ERR_error_string(ERR_get_error(), NULL)); OSSL_PROVIDER_unload(openssl_legacy); return 1; }