update cacert file path, fixtest

This commit is contained in:
Dario 2019-11-19 09:24:03 +01:00
parent 87fb45e5e2
commit 1f2a832e37
5 changed files with 9 additions and 3 deletions

View File

@ -11,6 +11,7 @@
#include "Poco/SharedPtr.h"
#include "Poco/Mutex.h"
#include "Poco/Path.h"
#include "Poco/FileStream.h"
#include "Poco/LocalDateTime.h"
#include "Poco/DateTimeFormat.h"
@ -129,7 +130,7 @@ namespace ServerConfig {
g_SSL_CLient_Context = new Context(Context::CLIENT_USE, "cacert.pem", Context::VERIFY_RELAXED, Context::OPT_DEFAULTS);
#else
g_SSL_CLient_Context = new Context(Context::CLIENT_USE, "", "", "cacert.pem", Context::VERIFY_RELAXED, 9, true, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
g_SSL_CLient_Context = new Context(Context::CLIENT_USE, "", "", Poco::Path::config() + "grd_login/cacert.pem", Context::VERIFY_RELAXED, 9, true, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
#endif
} catch(Poco::Exception& ex) {
printf("[ServerConfig::initSSLClientContext] error init ssl context, maybe no cacert.pem found?\nPlease make sure you have cacert.pem (CA/root certificates) next to binary from https://curl.haxx.se/docs/caextract.html\n");

View File

@ -289,7 +289,8 @@ void SessionManager::checkTimeoutSession()
mWorkingMutex.lock();
auto now = Poco::DateTime();
// random variance within 10 seconds for timeout to make it harder to get information and hack the server
auto timeout = Poco::Timespan(ServerConfig::g_SessionTimeout * 60, randombytes_random() % 10000000);
//auto timeout = Poco::Timespan(ServerConfig::g_SessionTimeout * 60, randombytes_random() % 10000000);
auto timeout = Poco::Timespan(1, 0);
std::stack<int> toRemove;
for (auto it = mRequestSessionMap.begin(); it != mRequestSessionMap.end(); it++) {
if (!it->second->isActive()) continue;

View File

@ -17,7 +17,9 @@ namespace UniLib {
if(len > 7) len = 7;
memcpy(nameBuffer, name, len);
int i = 0;
ServerConfig::g_ServerKeySeed->put(threadCount, 1726199827);
if (ServerConfig::g_ServerKeySeed) {
ServerConfig::g_ServerKeySeed->put(threadCount, 1726199827);
}
for(int i = 0; i < threadCount; i++) {
sprintf(&nameBuffer[len], "%.2d", i);
mThreads[i] = new CPUShedulerThread(this, nameBuffer);

View File

@ -2,6 +2,7 @@
#include "TestTasks.h"
#include "Poco/Environment.h"
#include <sodium.h>
#include <math.h>
#include "Poco/Logger.h"
#include "Poco/Path.h"

View File

@ -11,6 +11,7 @@ void fillTests()
}
int load() {
// init server config, init seed array
fillTests();
for (std::list<Test*>::iterator it = gTests.begin(); it != gTests.end(); it++)
{