andre@990: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik andre@990: * Software engineering by Intevation GmbH andre@990: * andre@990: * This file is Free Software under the GNU GPL (v>=2) andre@990: * and comes with ABSOLUTELY NO WARRANTY! andre@990: * See LICENSE.txt for details. andre@990: */ andre@990: andre@990: /**@file base implemetation of sslconnection. */ andre@990: andre@990: #include "sslconnection.h" andre@990: andre@990: #include andre@990: andre@990: SSLConnection::SSLConnection(const QString& url, andre@990: const QByteArray& certificate) : andre@990: mUrl(url), andre@990: mPinnedCert(certificate), andre@990: mInitialized(false), andre@990: mConnected(false), andre@990: mNeedsReset(false), andre@990: mServerFD(-1), andre@990: mErrorState(NoError) andre@990: { andre@990: if (certificate.isEmpty()) { andre@990: #ifdef RELEASE_BUILD andre@990: /* TODO Change certificate here in case of release build */ andre@990: QFile certResource(":certs/intevation.de"); andre@990: #else andre@990: QFile certResource(":certs/intevation.de"); andre@990: #endif andre@990: certResource.open(QFile::ReadOnly); andre@990: mPinnedCert = certResource.readAll(); andre@990: certResource.close(); andre@990: } andre@990: } andre@990: andre@990: void SSLConnection::setProxy(const QUrl &proxyUrl) andre@990: { andre@990: Q_UNUSED(proxyUrl); andre@990: qWarning() << "Set proxy not supported"; andre@990: }