httpabstractserver: do not block when accessing a keychain

Similar to httpserver test.

Task-number: QTBUG-130500
Pick-to: 6.8 6.9
Change-Id: I3597d982c523980745fb6f08659c39a17a317780
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
This commit is contained in:
Timur Pocheptsov 2025-01-07 08:58:49 +01:00
parent 89546a6a1e
commit ac66fc9a48
1 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,8 @@
#include <QtTest/qtesteventloop.h>
#include <QtCore/qregularexpression.h>
#include <QtCore/qoperatingsystemversion.h>
#include <QtCore/qsystemdetection.h>
#include <QtCore/qurl.h>
#include <QtHttpServer/qhttpserverrequest.h>
#include <QtHttpServer/qhttpserverresponder.h>
@ -415,6 +417,19 @@ void tst_QAbstractHttpServer::verifyWebSocketUpgrades()
tcpServer.listen();
server.bind(&tcpServer);
#if QT_CONFIG(ssl)
#ifdef Q_OS_MACOS
#if !QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(150000, 180000)
// Starting from macOS 15 our temporary keychain is ignored.
// We have to use kSecImportToMemoryOnly/kCFBooleanTrue key/value
// instead. This way we don't have to use QT_SSL_USE_TEMPORARY_KEYCHAIN anymore.
if (QSslSocket::activeBackend() == QLatin1String("securetransport")
&& QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSequoia) {
// We were built with SDK below 15, but a file-based keychains are not working anymore on macOS 15...
QSKIP("This test will block in keychain access");
}
#endif // QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE
#endif // Q_OS_MACOS
QSslServer sslServer;
QSslConfiguration sslConfiguration = QSslConfiguration::defaultConfiguration();
sslConfiguration.setLocalCertificate(QSslCertificate(QByteArray(g_certificate)));