X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fnetworkconnection.cpp;h=02bd25922a4e8d10e1d38eeaac04971f41cbe44e;hb=b28143aec8a66798a80ea77bc5838dd558468a99;hp=97c573a8844e7b3c497c88dfb33ee58359061ba6;hpb=7d371a32b6fcde653ecfdfb5496d4545fd721e39;p=quassel.git diff --git a/src/core/networkconnection.cpp b/src/core/networkconnection.cpp index 97c573a8..02bd2592 100644 --- a/src/core/networkconnection.cpp +++ b/src/core/networkconnection.cpp @@ -86,6 +86,23 @@ NetworkConnection::NetworkConnection(Network *network, CoreSession *session) connect(network, SIGNAL(autoReconnectRetriesSet(quint16)), this, SLOT(autoReconnectSettingsChanged())); #ifndef QT_NO_OPENSSL + { + QFile certFile(quasselDir().absolutePath() + "/quasselClientCert.pem"); + certFile.open(QIODevice::ReadOnly); + QSslCertificate cert(&certFile); + certFile.close(); + + certFile.open(QIODevice::ReadOnly); + QSslKey key(&certFile, QSsl::Rsa); + certFile.close(); + + if ( !cert.isNull() && cert.isValid() && + !key.isNull() ) { + socket.setLocalCertificate(cert); + socket.setPrivateKey(key); + } + } + connect(&socket, SIGNAL(encrypted()), this, SLOT(socketEncrypted())); connect(&socket, SIGNAL(sslErrors(const QList &)), this, SLOT(sslErrors(const QList &))); #endif