Ensure OpenSSL config file is only read from app dir

This commit is contained in:
Daniel Molkentin 2016-08-05 12:36:21 +02:00
parent 7de70516f1
commit 5a57e4a7a6
2 changed files with 12 additions and 0 deletions

View file

@ -272,6 +272,12 @@ void selectiveSyncFixup(OCC::SyncJournalDb *journal, const QStringList &newList)
int main(int argc, char **argv) { int main(int argc, char **argv) {
QCoreApplication app(argc, argv); QCoreApplication app(argc, argv);
#ifdef Q_OS_WIN
// Ensure OpenSSL config file is only loaded from app directory
QString opensslConf = QCoreApplication::applicationDirPath()+QString("/openssl.cnf");
qputenv("OPENSSL_CONF", opensslConf.toLocal8Bit());
#endif
qsrand(QTime::currentTime().msec() * QCoreApplication::applicationPid()); qsrand(QTime::currentTime().msec() * QCoreApplication::applicationPid());
CmdOptions options; CmdOptions options;

View file

@ -105,6 +105,12 @@ Application::Application(int &argc, char **argv) :
{ {
_startedAt.start(); _startedAt.start();
#ifdef Q_OS_WIN
// Ensure OpenSSL config file is only loaded from app directory
QString opensslConf = QCoreApplication::applicationDirPath()+QString("/openssl.cnf");
qputenv("OPENSSL_CONF", opensslConf.toLocal8Bit());
#endif
// TODO: Can't set this without breaking current config paths // TODO: Can't set this without breaking current config paths
// setOrganizationName(QLatin1String(APPLICATION_VENDOR)); // setOrganizationName(QLatin1String(APPLICATION_VENDOR));
setOrganizationDomain(QLatin1String(APPLICATION_REV_DOMAIN)); setOrganizationDomain(QLatin1String(APPLICATION_REV_DOMAIN));