X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.cpp;h=8a1c777135038ffae1300fd891745fd78ecfa419;hp=50bfa739e35e1042bd38a947d9b793f52ce8e30b;hb=9a36f8e55bfa485467e093fba669841fdfacda2f;hpb=109e990662d25b98e5d5a159c4cad7c93e56b2fe diff --git a/src/core/core.cpp b/src/core/core.cpp index 50bfa739..8a1c7771 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -334,7 +334,6 @@ void Core::stopListening() { } void Core::incomingConnection() { - // TODO implement SSL while(server.hasPendingConnections()) { QTcpSocket *socket = server.nextPendingConnection(); connect(socket, SIGNAL(disconnected()), this, SLOT(clientDisconnected())); @@ -385,9 +384,14 @@ void Core::processClientMessage(QTcpSocket *socket, const QVariantMap &msg) { "Up %3d%4h%5m (since %6)").arg(Global::quasselVersion).arg(Global::quasselBuild) .arg(updays).arg(uphours,2,10,QChar('0')).arg(upmins,2,10,QChar('0')).arg(startTime.toString(Qt::TextDate)); +#ifndef QT_NO_OPENSSL SslServer *sslServer = qobject_cast(&server); QSslSocket *sslSocket = qobject_cast(socket); bool supportSsl = (bool)sslServer && (bool)sslSocket && sslServer->certIsValid(); +#else + bool supportSsl = false; +#endif + reply["SupportSsl"] = supportSsl; // switch to ssl after client has been informed about our capabilities (see below) @@ -422,13 +426,14 @@ void Core::processClientMessage(QTcpSocket *socket, const QVariantMap &msg) { reply["MsgType"] = "ClientInitAck"; SignalProxy::writeDataToDevice(socket, reply); +#ifndef QT_NO_OPENSSL // after we told the client that we are ssl capable we switch to ssl mode if(supportSsl && msg["UseSsl"].toBool()) { qDebug() << "Starting TLS for Client:" << qPrintable(socket->peerAddress().toString()); connect(sslSocket, SIGNAL(sslErrors(const QList &)), this, SLOT(sslErrors(const QList &))); sslSocket->startServerEncryption(); } - +#endif } else { // for the rest, we need an initialized connection @@ -515,12 +520,14 @@ SessionThread *Core::createSession(UserId uid, bool restore) { return sess; } +#ifndef QT_NO_OPENSSL void Core::sslErrors(const QList &errors) { Q_UNUSED(errors); QSslSocket *socket = qobject_cast(sender()); if(socket) socket->ignoreSslErrors(); } +#endif void Core::socketError(QAbstractSocket::SocketError err) { QAbstractSocket *socket = qobject_cast(sender());