X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.cpp;h=21e7c16f9f1b2926592ea6dc2ffac17e8cde193a;hp=50bfa739e35e1042bd38a947d9b793f52ce8e30b;hb=444e91f948b435e652205c4d0f1148906e9e86dc;hpb=b79832bf9c4c21b05629cfd2fdbd008ad690572f diff --git a/src/core/core.cpp b/src/core/core.cpp index 50bfa739..21e7c16f 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 @@ -463,7 +468,7 @@ void Core::processClientMessage(QTcpSocket *socket, const QVariantMap &msg) { } reply["MsgType"] = "ClientLoginAck"; SignalProxy::writeDataToDevice(socket, reply); - qDebug() << qPrintable(tr("Client %1 initialized and authentificated successfully as \"%2\".").arg(socket->peerAddress().toString(), msg["User"].toString())); + qDebug() << qPrintable(tr("Client %1 initialized and authentificated successfully as \"%2\" (UserId: %3).").arg(socket->peerAddress().toString(), msg["User"].toString()).arg(uid.toInt())); setupClientSession(socket, uid); } } @@ -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());