/***************************************************************************
- * Copyright (C) 2005-2016 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#endif
#include <QDateTime>
-#include <QFile>
-#include "logger.h"
#include "quassel.h"
+#include "logmessage.h"
#ifdef HAVE_SSL
quWarning()
<< "SslServer: Unable to set certificate file\n"
<< " Quassel Core will still work, but cannot provide SSL for client connections.\n"
- << " Please see http://quassel-irc.org/faq/cert to learn how to enable SSL support.";
+ << " Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.";
sslWarningShown = true;
}
}
quWarning()
<< "SslServer: Unable to reload certificate file, reverting\n"
<< " Quassel Core will use the previous key to provide SSL for client connections.\n"
- << " Please see http://quassel-irc.org/faq/cert to learn how to enable SSL support.";
+ << " Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.";
} else {
quWarning()
<< "SslServer: Unable to reload certificate file\n"
<< " Quassel Core will still work, but cannot provide SSL for client connections.\n"
- << " Please see http://quassel-irc.org/faq/cert to learn how to enable SSL support.";
+ << " Please see https://quassel-irc.org/faq/cert to learn how to enable SSL support.";
}
return false;
}
return false;
}
- untestedKey = QSslKey(&keyFile, QSsl::Rsa);
+ untestedKey = loadKey(&keyFile);
keyFile.close();
} else {
- untestedKey = QSslKey(&certFile, QSsl::Rsa);
+ untestedKey = loadKey(&certFile);
}
certFile.close();
}
+QSslKey SslServer::loadKey(QFile *keyFile)
+{
+ QSslKey key;
+ key = QSslKey(keyFile, QSsl::Rsa);
+#if QT_VERSION >= 0x050500
+ if (key.isNull()) {
+ if (!keyFile->reset()) {
+ quWarning() << "SslServer: IO error reading key file";
+ return key;
+ }
+ key = QSslKey(keyFile, QSsl::Ec);
+ }
+#endif
+ return key;
+}
+
+
#endif // HAVE_SSL