summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2022-02-10 17:42:51 +0100
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2022-02-10 18:34:41 +0100
commit4dbe4d250ac3c91b2caaf0a2fc592ecd3eac39db (patch)
treea80f1f3246217a5788e6a4fa27b2bbb1e29603c4
parente731f10f3689b110ad31af76340e531907ab8bee (diff)
tst_qhttpserver: Don't check for OpenSSL support when ignoring errors
Always ignore the same set of errors instead. At least on macOS it is possible to compile Qt with OpenSSL support but don't have it at runtime. Fixes: QTBUG-100479 Change-Id: I213de297f840e6ef344fc87317103a9766f0598b Reviewed-by: Jesus Fernandez <jsfdez@gmail.com> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--tests/auto/qhttpserver/tst_qhttpserver.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/tests/auto/qhttpserver/tst_qhttpserver.cpp b/tests/auto/qhttpserver/tst_qhttpserver.cpp
index cb6b840..db07383 100644
--- a/tests/auto/qhttpserver/tst_qhttpserver.cpp
+++ b/tests/auto/qhttpserver/tst_qhttpserver.cpp
@@ -383,20 +383,13 @@ void tst_QHttpServer::initTestCase()
sslUrlBase = QStringLiteral("https://localhost:%1%2").arg(port);
- QList<QSslError> expectedSslErrors;
-
-// 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
-
- expectedSslErrors.append(QSslError(FLUKE_CERTIFICATE_ERROR,
- QSslCertificate(g_certificate)));
- expectedSslErrors.append(QSslError(QSslError::HostNameMismatch,
- QSslCertificate(g_certificate)));
+ const QList<QSslError> expectedSslErrors = {
+ QSslError(QSslError::SelfSignedCertificate, QSslCertificate(g_certificate)),
+ // Non-OpenSSL backends are not able to report a specific error code
+ // for self-signed certificates.
+ QSslError(QSslError::CertificateUntrusted, QSslCertificate(g_certificate)),
+ QSslError(QSslError::HostNameMismatch, QSslCertificate(g_certificate)),
+ };
connect(&networkAccessManager, &QNetworkAccessManager::sslErrors,
[expectedSslErrors](QNetworkReply *reply,