diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2012-09-30 16:48:52 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2012-09-30 16:48:52 +0200 |
commit | 630923d0de4a5cab558531e943370f00a64b316d (patch) | |
tree | 144e29d4785de0bfd46c65cd7977bd59e8d5ab09 /distfoldd/server.cc | |
parent | 0a174260c5dd04d516da7a6021e681d49c312547 (diff) | |
download | distfold-630923d0de4a5cab558531e943370f00a64b316d.tar.gz distfold-630923d0de4a5cab558531e943370f00a64b316d.zip |
autogenerate keys and autostartup daemon
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(); |