diff options
Diffstat (limited to 'distfoldd/server.cc')
-rw-r--r-- | distfoldd/server.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/distfoldd/server.cc b/distfoldd/server.cc index 0361466..4c7c222 100644 --- a/distfoldd/server.cc +++ b/distfoldd/server.cc @@ -2,6 +2,7 @@ #include <QtCore/QDir> #include <QtNetwork/QSslSocket> +#include "localkey.h" #include "server.h" Server::Server(QObject *parent) : @@ -15,8 +16,8 @@ Server::Server(QObject *parent) : void Server::loadKeys() { - QDir config_dir(QDir::home().absoluteFilePath(".config/distfold")); - QFile cert_file(config_dir.absoluteFilePath("server.crt")); + QDir local_key_dir(LocalKey::localKeyDir()); + QFile cert_file(local_key_dir.absoluteFilePath("server.crt")); if (cert_file.open(QIODevice::ReadOnly)) { _cert = QSslCertificate(&cert_file, QSsl::Pem); cert_file.close(); @@ -24,7 +25,7 @@ void Server::loadKeys() if (_cert.isNull()) { qWarning() << "Could not load server certificate"; } - QFile key_file(config_dir.absoluteFilePath("server.key")); + QFile key_file(local_key_dir.absoluteFilePath("server.key")); if (key_file.open(QIODevice::ReadOnly)) { _key = QSslKey(&key_file, QSsl::Rsa, QSsl::Pem); key_file.close(); |