From a48d7f0c737451e2eaa4232f1577a3fca7218713 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 23 Oct 2024 15:53:01 +0200 Subject: [PATCH] Fix prior change: no need for check when OpenSSL is active backend It's not using keychains and not triggering a blocking system dialog. Change-Id: Id2a3b74ab3647890747fba9b8d261ab3e60fb3bc Reviewed-by: Timur Pocheptsov (cherry picked from commit 07a0e4496ddf15ef469c3b244270300b9c855d44) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/network-helpers.h | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) 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; }