summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2015-08-09 07:06:52 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-08-09 07:06:52 +0000
commit5bfac9d653357c906946563b9494d7ae69cdad92 (patch)
tree0cc119af894a398497eba6f56fe2f224f6947616 /tests/auto/network/access
parentf08e1ecdc88e9373a31c1505d5db7f905431c644 (diff)
parent77da617dc8e378a631ee8c15b1b414f16b87f147 (diff)
Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/network/access')
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 5a685037a1..4d41d4beb1 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -88,6 +88,14 @@ Q_DECLARE_METATYPE(QSharedPointer<char>)
#include "../../../network-settings.h"
+// Non-OpenSSL backends are not able to report a specific error code
+// for self-signed certificates.
+#ifndef QT_NO_OPENSSL
+#define FLUKE_CERTIFICATE_ERROR QSslError::SelfSignedCertificate
+#else
+#define FLUKE_CERTIFICATE_ERROR QSslError::CertificateUntrusted
+#endif
+
Q_DECLARE_METATYPE(QAuthenticator*)
#ifndef QT_NO_NETWORKPROXY
Q_DECLARE_METATYPE(QNetworkProxyQuery)
@@ -6047,8 +6055,8 @@ void tst_QNetworkReply::ignoreSslErrorsList_data()
QList<QSslError> expectedSslErrors;
QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
- QSslError rightError(QSslError::SelfSignedCertificate, certs.at(0));
- QSslError wrongError(QSslError::SelfSignedCertificate);
+ QSslError rightError(FLUKE_CERTIFICATE_ERROR, certs.at(0));
+ QSslError wrongError(FLUKE_CERTIFICATE_ERROR);
QTest::newRow("SSL-failure-empty-list") << "https://" + QtNetworkSettings::serverName() + "/index.html" << expectedSslErrors << QNetworkReply::SslHandshakeFailedError;
expectedSslErrors.append(wrongError);