From 99b0a56a6ab9311b0a755b07c13aeb2a3556235d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 22 Dec 2018 20:05:45 -0800 Subject: [PATCH] Add additional cert pinning assert --- app/backend/nvhttp.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/backend/nvhttp.cpp b/app/backend/nvhttp.cpp index cade2957..a7653f15 100644 --- a/app/backend/nvhttp.cpp +++ b/app/backend/nvhttp.cpp @@ -410,6 +410,10 @@ NvHTTP::openConnection(QUrl baseUrl, QNetworkReply* reply = m_Nam.get(request); + // Assert that we always have a server cert for HTTPS, since + // the request will fail anyway if we do not. + Q_ASSERT(!m_ServerCert.isNull() || baseUrl == m_BaseUrlHttp); + if (!m_ServerCert.isNull()) { // Pin the server certificate received during pairing QList expectedSslErrors;