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: emanuel@1053: /** emanuel@1053: * @file sslconnection.cpp emanuel@1053: * @brief Base implemetation of sslconnection. emanuel@1053: */ 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@1162: /* TODO (issue95) Change certificate here in case of release build */ andre@1088: QFile certResource(":certs/ssl-test"); andre@990: #else andre@1088: QFile certResource(":certs/ssl-test"); 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: }