diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/bnetserver/Main.cpp | 9 | ||||
| -rw-r--r-- | src/server/worldserver/Main.cpp | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/server/bnetserver/Main.cpp b/src/server/bnetserver/Main.cpp index 7de39a4e01c..c8c414aeacd 100644 --- a/src/server/bnetserver/Main.cpp +++ b/src/server/bnetserver/Main.cpp @@ -34,6 +34,7 @@ #include "IPLocation.h" #include "LoginRESTService.h" #include "MySQLThreading.h" +#include "OpenSSLCrypto.h" #include "ProcessPriority.h" #include "RealmList.h" #include "SecretMgr.h" @@ -41,6 +42,7 @@ #include "SslContext.h" #include "Util.h" #include <boost/asio/signal_set.hpp> +#include <boost/dll/runtime_symbol_info.hpp> #include <boost/program_options.hpp> #include <boost/filesystem/operations.hpp> #include <google/protobuf/stubs/common.h> @@ -134,10 +136,9 @@ int main(int argc, char** argv) for (std::string const& key : overriddenKeys) TC_LOG_INFO("server.authserver", "Configuration field '%s' was overridden with environment variable.", key.c_str()); - // Seed the OpenSSL's PRNG here. - // That way it won't auto-seed when calling BigNumber::SetRand and slow down the first world login - BigNumber seed; - seed.SetRand(16 * 8); + OpenSSLCrypto::threadsSetup(boost::dll::program_location().remove_filename()); + + std::shared_ptr<void> opensslHandle(nullptr, [](void*) { OpenSSLCrypto::threadsCleanup(); }); // bnetserver PID file creation std::string pidFile = sConfigMgr->GetStringDefault("PidFile", ""); diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index c78b42f152d..22555f13eec 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -56,6 +56,7 @@ #include <openssl/opensslv.h> #include <openssl/crypto.h> #include <boost/asio/signal_set.hpp> +#include <boost/dll/runtime_symbol_info.hpp> #include <boost/filesystem/operations.hpp> #include <boost/program_options.hpp> #include <google/protobuf/stubs/common.h> @@ -216,7 +217,7 @@ extern int main(int argc, char** argv) for (std::string const& key : overriddenKeys) TC_LOG_INFO("server.worldserver", "Configuration field '%s' was overridden with environment variable.", key.c_str()); - OpenSSLCrypto::threadsSetup(); + OpenSSLCrypto::threadsSetup(boost::dll::program_location().remove_filename()); std::shared_ptr<void> opensslHandle(nullptr, [](void*) { OpenSSLCrypto::threadsCleanup(); }); |
