Attach swift client certificate if url is swift shared url

refs #762
This commit is contained in:
Roland Winklmeier
2017-01-24 23:13:13 +01:00
committed by Mathew Sutcliffe
parent 7be604741c
commit 47aa04b5e9

View File

@@ -1135,6 +1135,19 @@ namespace BlackCore
QNetworkRequest r(request); // no QObject
CNetworkUtils::ignoreSslVerification(r);
CNetworkUtils::setSwiftUserAgent(r);
// If url is one of the shared urls, add swift client SSL certificate
const CUrlList swiftSharedUrls = getGlobalSetup().getSwiftSharedUrls();
for (const CUrl &sharedUrl : swiftSharedUrls)
{
QString urlString = request.url().toString();
if (urlString.startsWith(sharedUrl.toQString()))
{
CNetworkUtils::setSwiftClientSslCertificate(r);
break;
}
}
QNetworkReply *reply = method(this->m_accessManager, r);
reply->setProperty("started", QVariant(QDateTime::currentMSecsSinceEpoch()));
if (callback)