diff --git a/tests/auto/network-helpers.h b/tests/auto/network-helpers.h index cb6bd2a45fd..99125a88443 100644 --- a/tests/auto/network-helpers.h +++ b/tests/auto/network-helpers.h @@ -1,25 +1,36 @@ // Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include + #include +#if QT_CONFIG(ssl) +#include +#endif + namespace QtNetworkTestHelpers { bool isSecureTransportBlockingTest() { #ifdef Q_OS_MACOS +#if QT_CONFIG(ssl) + if (QSslSocket::activeBackend() == QLatin1String("securetransport")) { #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. - return false; + // 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. + return false; #else - if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSequoia) { - // We were built with SDK below 15, but a file-based keychains are not working anymore on macOS 15... - return true; + if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSequoia) { + // We were built with SDK below 15, and running on/above 15, but file-based + // keychains are not working anymore on macOS 15, blocking the test execution. + return true; + } +#endif // Platform SDK. } -#endif +#endif // QT_CONFIG(ssl) #endif // Q_OS_MACOS return false; }