)
endif()
endif()
- add_feature_info("WITH_WEBKIT, QtWebKit and QtWebKitWidgets modules" Qt5WebKitWidgets_FOUND "Support showing previews for URLs in chat")
+
+ if (WITH_WEBKIT AND Qt5WebKitWidgets_FOUND)
+ set(HAVE_WEBKIT true)
+ endif()
+ add_feature_info("WITH_WEBKIT, QtWebKit and QtWebKitWidgets modules" HAVE_WEBKIT "Support showing previews for URLs in chat")
# KDE Frameworks
################
# enviroment
if (NOT GIT_HEAD OR NOT GIT_DESCRIBE)
if (DEFINED ENV{GIT_HEAD})
- set(GIT_HEAD ${GIT_HEAD})
+ set(GIT_HEAD $ENV{GIT_HEAD})
endif ()
if (DEFINED ENV{GIT_DESCRIBE})
- set(GIT_DESCRIBE ${GIT_DESCRIBE})
+ set(GIT_DESCRIBE $ENV{GIT_DESCRIBE})
endif()
endif()
# endif
#endif
- // Migrate settings from KDE4 to KF5 if appropriate
-#ifdef HAVE_KF5
- Kdelibs4ConfigMigrator migrator(QCoreApplication::applicationName());
- migrator.setConfigFiles(QStringList() << "quasselrc" << "quassel.notifyrc");
- migrator.migrate();
-#endif
-
AbstractCliParser *cliParser;
#ifdef HAVE_KDE4
cliParser->addOption("oidentd-conffile", 0, "Set path to oidentd configuration file", "file");
#ifdef HAVE_SSL
cliParser->addSwitch("require-ssl", 0, "Require SSL for remote (non-loopback) client connections");
+ cliParser->addOption("ssl-cert", 0, "Specify the path to the SSL Certificate", "path", "configdir/quasselCert.pem");
+ cliParser->addOption("ssl-key", 0, "Specify the path to the SSL key", "path", "ssl-cert-path");
#endif
cliParser->addSwitch("enable-experimental-dcc", 0, "Enable highly experimental and unfinished support for CTCP DCC (DANGEROUS)");
#endif
}
#endif
+// Migrate settings from KDE4 to KF5 if appropriate
+#ifdef HAVE_KF5
+ Kdelibs4ConfigMigrator migrator(QCoreApplication::applicationName());
+ migrator.setConfigFiles(QStringList() << "quasselrc" << "quassel.notifyrc");
+ migrator.migrate();
+#endif
+
#ifdef HAVE_KF5
// FIXME: This should be done after loading the translation catalogue, but still in main()
AboutData aboutData;
_isCertValid(false)
{
static bool sslWarningShown = false;
- if (!setCertificate(Quassel::configDirPath() + "quasselCert.pem")) {
+
+ QString ssl_cert;
+ QString ssl_key;
+
+ if(Quassel::isOptionSet("ssl-cert")) {
+ ssl_cert = Quassel::optionValue("ssl-cert");
+ } else {
+ ssl_cert = Quassel::configDirPath() + "quasselCert.pem";
+ }
+
+ if(Quassel::isOptionSet("ssl-key")) {
+ ssl_key = Quassel::optionValue("ssl-key");
+ } else {
+ ssl_key = ssl_cert;
+ }
+
+ if (!setCertificate(ssl_cert, ssl_key)) {
if (!sslWarningShown) {
quWarning()
<< "SslServer: Unable to set certificate file\n"
}
-bool SslServer::setCertificate(const QString &path)
+bool SslServer::setCertificate(const QString &path, const QString &keyPath)
{
_isCertValid = false;
return false;
}
- _key = QSslKey(&certFile, QSsl::Rsa);
+ // load key from keyPath if it differs from path, otherwise load key from path
+ if(path != keyPath) {
+ QFile keyFile(keyPath);
+ if(!keyFile.exists()) {
+ quWarning() << "SslServer: Key file" << qPrintable(keyPath) << "does not exist";
+ return false;
+ }
+
+ if (!keyFile.open(QIODevice::ReadOnly)) {
+ quWarning()
+ << "SslServer: Failed to open key file" << qPrintable(keyPath)
+ << "error:" << keyFile.error();
+ return false;
+ }
+
+ _key = QSslKey(&keyFile, QSsl::Rsa);
+ keyFile.close();
+ } else {
+ _key = QSslKey(&certFile, QSsl::Rsa);
+ }
+
certFile.close();
if (_cert.isNull()) {
quWarning() << "SslServer: Certificate blacklisted";
}
if (_key.isNull()) {
- quWarning() << "SslServer:" << qPrintable(path) << "contains no key data";
+ quWarning() << "SslServer:" << qPrintable(keyPath) << "contains no key data";
return false;
}
virtual void incomingConnection(int socketDescriptor);
#endif
- virtual bool setCertificate(const QString &path);
+ virtual bool setCertificate(const QString &path, const QString &keyPath);
private:
QLinkedList<QTcpSocket *> _pendingConnections;
qt_add_dbus_adaptor (SOURCES ../../interfaces/org.kde.StatusNotifierItem.xml statusnotifieritemdbus.h StatusNotifierItemDBus)
endif()
-if (QT_QTWEBKIT_FOUND OR Qt5WebKitWidgets_FOUND)
+if (HAVE_WEBKIT)
add_definitions(-DHAVE_WEBKIT)
list(APPEND QT_MODULES WebKit)
if (USE_QT5)