This is untested, so please let me know if there's still work to be done.
#include "signalproxy.h"
-ClientSyncer::ClientSyncer(QObject *parent) : QObject(parent) {
+ClientSyncer::ClientSyncer(QObject *parent)
+ : QObject(parent)
+{
socket = 0;
blockSize = 0;
connect(Client::signalProxy(), SIGNAL(disconnected()), this, SLOT(coreSocketDisconnected()));
-
}
ClientSyncer::~ClientSyncer() {
-
-
}
void ClientSyncer::coreHasData() {
#ifndef QT_NO_OPENSSL
QSslSocket *sock = new QSslSocket(Client::instance());
#else
+ if(conn["useSsl"].toBool()) {
+ emit connectionError(tr("<b>This client is built without SSL Support!</b><br />Disable the usage of SSL in the account settings."));
+ emit encrypted(false);
+ return;
+ }
QTcpSocket *sock = new QTcpSocket(Client::instance());
#endif
return;
}
emit connectionMsg(msg["CoreInfo"].toString());
+
+#ifndef QT_NO_OPENSSL
if(coreConnectionInfo["useSsl"].toBool()) {
if(msg["SupportSsl"].toBool()) {
QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
- if(sslSocket) {
- connect(sslSocket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
- sslSocket->startClientEncryption();
- emit encrypted(true);
- } else {
- emit connectionError(tr("<b>This client is built without SSL Support!</b><br />Disable the usage of SSL in the account settings."));
- emit encrypted(false);
- disconnectFromCore();
- return;
- }
+ Q_ASSERT(sslSocket);
+ connect(sslSocket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
+ sslSocket->startClientEncryption();
+ emit encrypted(true);
} else {
emit connectionError(tr("<b>The Quassel Core you are trying to connect to does not support SSL!</b><br />If you want to connect anyways, disable the usage of SSL in the account settings."));
emit encrypted(false);
return;
}
}
+#endif
if(!msg["Configured"].toBool()) {
// start wizard
}
}
+#ifndef QT_NO_OPENSSL
void ClientSyncer::sslErrors(const QList<QSslError> &errors) {
qDebug() << "SSL Errors:";
foreach(QSslError err, errors)
if(socket)
socket->ignoreSslErrors();
}
+#endif
#include <QPointer>
#include <QString>
-#include <QTcpSocket>
-#include <QSslSocket>
#include <QVariantMap>
+#ifndef QT_NO_OPENSSL
+#include <QSslSocket>
+#else
+#include <QTcpSocket>
+#endif
+
class IrcUser;
class IrcChannel;
void sessionStateReceived(const QVariantMap &state);
void doCoreSetup(const QVariant &setupData);
+#ifndef QT_NO_OPENSSL
void sslErrors(const QList<QSslError> &errors);
+#endif
private:
QPointer<QIODevice> socket;
}
void Core::incomingConnection() {
- // TODO implement SSL
while(server.hasPendingConnections()) {
QTcpSocket *socket = server.nextPendingConnection();
connect(socket, SIGNAL(disconnected()), this, SLOT(clientDisconnected()));
"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<SslServer *>(&server);
QSslSocket *sslSocket = qobject_cast<QSslSocket *>(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)
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<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
sslSocket->startServerEncryption();
}
-
+#endif
} else {
// for the rest, we need an initialized connection
return sess;
}
+#ifndef QT_NO_OPENSSL
void Core::sslErrors(const QList<QSslError> &errors) {
Q_UNUSED(errors);
QSslSocket *socket = qobject_cast<QSslSocket *>(sender());
if(socket)
socket->ignoreSslErrors();
}
+#endif
void Core::socketError(QAbstractSocket::SocketError err) {
QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(sender());
#include <QString>
#include <QVariant>
#include <QTimer>
-#include <QTcpSocket>
+
+#ifndef QT_NO_OPENSSL
#include <QSslSocket>
+#include "sslserver.h"
+#else
+#include <QTcpSocket>
+#include <QTcpServer>
+#endif
#include "bufferinfo.h"
#include "message.h"
#include "global.h"
#include "sessionthread.h"
-#include "sslserver.h"
#include "types.h"
class CoreSession;
bool initStorage(QVariantMap dbSettings, bool setup = false);
+#ifndef QT_NO_OPENSSL
void sslErrors(const QList<QSslError> &errors);
+#endif
void socketError(QAbstractSocket::SocketError);
private:
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
+#ifndef QT_NO_OPENSSL
+
#include "sslserver.h"
#include <QSslSocket>
delete serverSocket;
}
}
+
+#endif // QT_NO_OPENSSL
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
+#ifndef QT_NO_OPENSSL
+
#ifndef SSLSERVER_H
#define SSLSERVER_H
};
#endif //SSLSERVER_H
+
+#endif QT_NO_OPENSSL
/*****************************************************************************************
* CoreAccountEditDlg
*****************************************************************************************/
-
CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, const QStringList &_existing, QWidget *parent) : QDialog(parent) {
ui.setupUi(this);
existing = _existing;
ui.port->setValue(acct["Port"].toUInt());
ui.useInternal->setChecked(acct["UseInternal"].toBool());
ui.accountName->setText(acct["AccountName"].toString());
+#ifndef QT_NO_OPENSSL
ui.useSsl->setChecked(account["useSsl"].toBool());
+#else
+ ui.useSsl->setChecked(false);
+ ui.useSsl->setEnabled(false);
+#endif
ui.useProxy->setChecked(account["useProxy"].toBool());
ui.proxyHost->setText(account["proxyHost"].toString());
ui.proxyPort->setValue(account["proxyPort"].toUInt());
{ using namespace Global;
quasselVersion = "0.2.0-alpha5-pre";
- quasselDate = "2008-03-31";
- quasselBuild = 677;
+ quasselDate = "2008-04-01";
+ quasselBuild = 679;
//! Minimum client build number the core needs
clientBuildNeeded = 642;