summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qsslsocket
Commit message (Collapse)AuthorAgeFilesLines
* Correct license for tools filesLucie Gérard2024-03-051-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tools file should be LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Icd5d5be2e04819617e68ff142924de1773bebbad Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Change license for tests filesLucie Gérard2024-02-042-2/+2
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Tests: remove blacklisted CIs no longer availableChristian Ehrlicher2023-12-061-5/+0
| | | | | | | | | | | | | | | | Remove the following CIs from BLACKLIST files as they are no longer used: - msvc-2015 - msvc-2017 - windows-7sp1 - opensuse-42.3 - ubuntu 16.04/18.04/20.04 - rhel 6.6/7.4/7.6 - redhatenterpriselinuxworkstation-6.6 Change-Id: Ief9550e3455a1ed211d978933262c8d5557b0fec Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Use SSL_CTX_set_dh_auto if DHparam is emptyAndré Klitzing2023-10-251-6/+10
| | | | | | | | | | [ChangeLog][QtNetwork][QSslDiffieHellmanParameters] An empty Diffie-Hellmann parameter enables auto selection of openssl backend. Fixes: QTBUG-117666 Change-Id: Ic2e0529d48542752ca801bcb4d609988e5ddff25 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QSslSocket: Remove compile-time #ifdef checkVolker Hilsheimer2023-10-231-4/+0
| | | | | | | | | | | Since we use runtime plugins now and the test doesn't use any symbols from openssl Amends 486b1aec1606d6d778da6203e28640cd79ae0291 Pick-to: 6.6 6.5 Change-Id: Ib66d1ca15835c41fe138c7830ce3edd0bdce0d5f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QSslSocket: remove #if openssl check for a definitionMårten Nordheim2023-10-201-2/+0
| | | | | | | | | | The declaration was moved out of the #if QT_CONFIG(openssl) block at some point, but the definition was not. This caused compilation errors when building without OpenSSL configured. Pick-to: 6.6 6.5 Change-Id: I41ed85fd57f5a912498e0f2517761b81a7b8673c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_QSslSocket: don't use deprecated RSA apiTimur Pocheptsov2023-08-291-0/+2
| | | | | | | | | OpenSSL 3.1.2 can be configured with no-deprecated option, in this case test fails to build. Pick-to: 6.6 6.5 6.2 Change-Id: Icaf457f55fb001b632922856dbe4bbb5bdba220e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QSslSocket: skip tests requiring TLS v 1.0 downgradeTimur Pocheptsov2023-08-221-0/+24
| | | | | | | | | | If OpenSSL version is 3.1.1 or above - this version moved the protocol under security level 0, but the default one is 1. Pick-to: 6.6 6.5 6.2 5.15 Fixes: QTBUG-116166 Change-Id: Iaabb2cf33e2a9f280d6167233ee16080dee808b0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Make network tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I000cd3b0809b6417c3b1ab520e4de746afee71fc Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Android: explicitly bundle the OpenSSL libs for testsAssam Boudjelthia2023-06-211-0/+1
| | | | | | | | | | Use the new argument to bundle the OpenSSL prebuilt libararies so that ssl operations are actually tested at runtime. Task-number: QTBUG-110025 Pick-to: 6.6 6.5 Change-Id: I0d73fed463a1724a9e0ee84ba603aa2ff1bc649b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QSslSocket: ignore order of sslErrors listMårten Nordheim2023-06-081-1/+8
| | | | | | | | | In Schannel it is not guaranteed CertificateBlacklisted will be the first error emitted. And it really does not make a difference anyway. Pick-to: 6.6 6.5 6.2 Change-Id: If041f913db9e78ac54e6f8bb2ba1bda110e7d64a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_QSslSocket: skip tests with specific cipher if unsupportedMårten Nordheim2023-06-081-2/+11
| | | | | Change-Id: If107ec596abc6d5fd82206e8deff9875dfb308c8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Skip diffie-hellman parameter test when not supportedMårten Nordheim2023-05-241-0/+2
| | | | | | | Pick-to: 6.5 Change-Id: I0c21aeea813ee48f8c62689dafce6f7fb9620001 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Revert "Skip socket and server tests on Ubuntu 22.04 and QEMU"Mårten Nordheim2023-03-201-6/+0
| | | | | | | | | This reverts commit 9286d46ee25f84d24a509e703e294f792cba1483. Reason for revert: Should be fixed by 5c6814fb18760f65bab0f8b9cd623ee5c874a58d Change-Id: I3a161df445af8dcbb61138d57e931a093a319027 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QTestEventLoop: add enterLoop(std::chrono::milliseconds) overloadAhmad Samir2023-03-031-9/+11
| | | | | | | Task-number: QTBUG-110059 Change-Id: Ibf1d76afd313e390103be4a22e44af7fb41ace1b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-171-18/+1
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Skip socket and server tests on Ubuntu 22.04 and QEMUVille Voutilainen2023-02-051-0/+6
| | | | | | | Task-number: QTBUG-107696 Change-Id: Ic9cecd0c8624e7e8211633ef8a8ce0339662b4f6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Try fixing auto-tests that need resolving openssl symbolsTimur Pocheptsov2022-12-021-0/+5
| | | | | | | | | | | | | For the case of static builds. Also, remove somewhat funny comment from the shared tlshelpers.h file. Fixes: QTBUG-105046 Pick-to: 6.4 6.2 Change-Id: I2fd677a11b64df89c0ad0237e1014f5e80144c24 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-69/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-1/+1
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QSslSocket::serverCipherPreferencies - fix for OpenSSL v3Timur Pocheptsov2022-09-082-11/+33
| | | | | | | | | | | | | Test was not really good to start with - it was assuming the presence of particular ciphersuites. Furthermore, it was ignoring the fact that TLS 1.2 and TLS 1.3 set ciphersuites differently in OpenSSL. Pick-to: 6.4 6.3 6.2 5.15 Task-number: QTBUG-106018 Task-number: QTBUG-95123 Change-Id: I6c8ba20154cdeb9275878462ab945729d6c82ecc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QSsSocket: fix verifyClientCertificate with OpenSSL 3Mårten Nordheim2022-09-051-1/+1
| | | | | | | | | | | | | OpenSSL 3 by default disables TLS < 1.2 in the conf files. We're not going to work against that, so we bump the version of TLS used. Keep the client-side TLS 1.0 Or Later just to keep testing that this part works. Task-number: QTBUG-95123 Task-number: QTBUG-106018 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: Ia6cb10495875de232d69a886832ae74c5f5ac15f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_QSslSocket::oldErrorsOnSocketReuse - make it work with OpenSSL v3Timur Pocheptsov2022-09-031-2/+4
| | | | | | | | | | | | | | | | The initial problem was in server not starting encryption, because its certificate was rejected by OpenSSL (v3) saying 'weak md'. After the certificate was replaced, we got another problem - due to the fixed TLS v.1 protocol for both client and server - handshake is interrupted early with 'tls v1 alert' and error message saying about not found signature algorithms. Don't fix the protocol version, use proper QSsl::SecureProtocols (default). Pick-to: 6.4 6.3 6.2 5.15 Task-number: QTBUG-106018 Task-number: QTBUG-95123 Change-Id: I0f22f5304f4405933ad511195bc61c640518e7d8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QSslSocket: regenerate certificate used for setLocalCertificateChainMårten Nordheim2022-09-0211-93/+511
| | | | | | | | | | | | | | The certificate was using SHA-1 for signing its certificate, which is considered 'not good enough' by some TLS libraries. Regenerate it with SHA-512 and a larger RSA key. Also include the files needed to generate it. Pick-to: 6.4 6.3 6.2 5.15 Task-number: QTBUG-106018 Task-number: QTBUG-95123 Change-Id: I535e047d540e663c8cec334695196044173949fc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_QSslSocket::protocolServerSide - make it work with OpenSSL v3Timur Pocheptsov2022-09-021-7/+0
| | | | | | | | | | | | | | OpenSSL v3 by default sets SECLEVEL = 2 unless overridden in conf files. SECLEVEL >= 1 means TLS <= 1.1 is disabled. Remove cases that were previously expected to work. Arguably, we should not test deprecated protocols at all, but the cases expecting a failure still work and logically correct. Task-number: QTBUG-95123 Task-number: QTBUG-106018 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: Ifa59fa902b433338dbed7abf086cfdef9470384c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-1/+1
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* tst_qsslsocket: remove schannel workarounds for old certificateMårten Nordheim2022-07-281-10/+0
| | | | | | | | The certificate was updated recently and doesn't have the same deprecated hash functions and small key size as the old one did. Change-Id: I301ad50a96a30483b92a6e30f61e78e8d6b955ca Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Network: Update expired certMårten Nordheim2022-06-241-15/+15
| | | | | | Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I233ffee5b720c0554071c1d49d4fb861736b2e2a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-28/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* tst_qsslsocket: remove tons of deprecation warningsMarc Mutz2022-04-121-65/+78
| | | | | | | | | | | | | | | | | The TLS v1.0 and v1.1 enums are all deprecated since 6.3. At the same time, the test requires their use, because none of the peers seeem to implement TLS v1.2, yet (cf. e.g. QTQAINFRA-4499). Fix by copying the relevant enum values into global variables and using those. This is a selective way to deal with the issue. The use of the enums is so widespread in the test that the alternative would have been to globally suppress deprecation warnings, which, however, may suppress warnings we may actually want to fix. Pick-to: 6.3 Change-Id: I4186be72209527fc404f3ba0a5a15f9719c64698 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QSslSocket (SecureTransport) add TLS 1.3 ciphersuitesTimur Pocheptsov2022-01-121-0/+39
| | | | | | | | | | | | | | | | | | | At some point we decided to support a custom set of ciphersuites specified by QSslConfiguration (which if you ask me was never a good idea). The law of unforseen consequiences bit us again: since we now give a set of ciphesuites to QSslConfiguration and set ciphesuites from the configuration a socket has, we are limited by the ciphersuites we know about at the moment of 'coding'. Meaning if an SDK was updated and CipherSuite.h later adds more ciphersuites, we miss them and 'don't support them', while we ... actually do. This patch tries to add some more ciphersuites introduced in TLS 1.3 (interesting, SecureTransport does not support TLS 1.3, but TLS 1.3 suites can be used in TLS 1.2 session). Pick-to: 6.2 6.3 5.15 Task-number: QTBUG-99368 Change-Id: I439b63845c4893e5621cffaf3bcaf62e2b643c74 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tests: Remove unused SRCDIR definesIevgenii Meshcheriakov2021-08-171-2/+0
| | | | | | | | | | | Remove SRCDIR defines from tests that don't use them. There is a standard define called QT_TESTCASE_SOURCEDIR that is available to all tests and serves the same purpose. Pick-to: 6.2 Change-Id: I2aa237739c011495e31641cca525dc0eeef3c870 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tst_QSslSocket - replace an old certificateTimur Pocheptsov2021-08-102-88/+84
| | | | | | | | | | Helped quite a lot with OpenSSL 3 not accepting some old algorithms. Pick-to: 6.2 6.1 5.15 Task-number: QTBUG-95123 Change-Id: If4894fa86eba7b002465fa661d436ae6ea751989 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QIODevice: rework validation policy for read() functionsAlex Trotsenko2021-08-011-3/+2
| | | | | | | | | | | - avoid calls to private and virtual functions, if the device is not open; - avoid repetitive checks in loops; - add missing checks in readLine() overloads; - remove check against unsuccessful resize(). Change-Id: I973d5931163b25db1c09c7c3b66f29ea90bb1b29 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* tst_QSslSocket: fix and clean up allowedProtocolNegotiationMårten Nordheim2021-07-201-10/+4
| | | | | | | | | | | The server's socket may not have been created yet, so use the server's signal instead. Switch to QCOMPARE to get better output. Delete the extra checking for schannel, we don't support Windows 8 anymore. Pick-to: 6.2 Change-Id: Icd310c32939cb577c9f3438789f667aa0a3a4d85 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_QSslSocket: Remove empty test functionsMårten Nordheim2021-06-251-10/+0
| | | | | | | | For flush() it's not clear what they wanted to test. isEncrypted() is tested indirectly in many of the other tests. Change-Id: Id6dfecbb25b7bba8f1a99518fd9c9e06280aaa9f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_qsslsocket: detect ALPN support (on server) using supportedFeatures()Timur Pocheptsov2021-06-251-17/+4
| | | | | | | Pick-to: 6.2 Change-Id: I30409667395bbe568823b8697dded41067a8346c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* tst_QSslSocket: Use supportedFeatures() instead of macroMårten Nordheim2021-06-241-4/+2
| | | | | | | | | It needs to be checked at runtime to know if the current backend supports it Pick-to: 6.2 Change-Id: I0998309149b109e2075a008b2b8d8115fa3688cc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* TLS: Mark TLS 1.0, 1.1 and DTLS 1.0 deprecatedMårten Nordheim2021-06-251-13/+102
| | | | | | | | | | | | As per the best practice laid forth in RFC-8996. TLS 1.2 was recommended from 2008 until TLS 1.3 was released in 2018. [ChangeLog][QtNetwork][QSslSocket] TLS 1.0, 1.1 and DTLS 1.0 are now deprecated, as recommended by RFC-8996. Fixes: QTBUG-92880 Change-Id: I90cebcfb07cfce623af7ac9f2b66ce9d02586b54 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QSslSocket: Set isEncrypted to false on disconnectMårten Nordheim2021-06-251-0/+1
| | | | | | | | | Since we're no longer connected, much less encrypted. Was done in schannel backend, but not in ST or OpenSSL Pick-to: 6.2 Change-Id: Ia49387be0088f899a0c89091f7e468dba1c0eee6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Introduce a mini-version of qsslsocket_openssl_symbols_p.h/.cppTimur Pocheptsov2021-06-091-4/+18
| | | | | | | | | | | For auto-tests that were temporarily disabled. Similar to network-settings.h, header-only stuff. Fixes: QTBUG-92866 Fixes: QTBUG-92877 Change-Id: I15b5c0b41f0d8bfe59b09c844884ff6d99e6d41a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QSslSocket::readBufferMaxSize() - workaround the flaky testTimur Pocheptsov2021-06-031-0/+12
| | | | | | Task-number: QTBUG-94186 Change-Id: I8c82f1fede8f9512f531f4ff17508b9e71ebf0b7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix auto-tests that are fooled by the presence of more than one pluginTimur Pocheptsov2021-05-271-98/+106
| | | | | | | | | | | | | | | It's possible that Qt is built with OpenSSL and some other backend. The ifdefs generated are not mutually exclusive anymore, as it was in the past. So tests should rely on the actual backend they have working at runtime. In the process of fixing the auto-tests, modernized feature #if-ery and some associated compilation issues. Fixes: QTBUG-92875 Change-Id: I2be1b924d506fd36dc4e2c6c9158b5023ff87f32 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Move plugin code from QtNetwork to qtbase/pluginsTimur Pocheptsov2021-04-221-109/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All TLS (and non-TLS) backends that QSsl classes rely on are now in plugins/tls (as openssl, securetransport, schannel and certonly plugins). For now, I have to disable some tests that were using OpenSSL calls - this to be refactored/re-thought. These include: qsslsocket auto-test (test-case where we work with private keys), qsslkey auto-test (similar to qsslsocket - test-case working with keys using OpenSSL calls). qasn1element moved to plugins too, so its auto-test have to be re-thought. Since now we can have more than one working TLS-backend on a given platform, the presence of OpenSSL also means I force this backend as active before running tests, to make sure features implemented only in OpenSSL-backend are tested. OCSP auto test is disabled for now, since it heavily relies on OpenSSL symbols (to be refactored). [ChangeLog][QtNetwork][QSslSocket] QSslSocket by default prefers 'openssl' backend if it is available. [ChangeLog][QtNetwork][QSslSocket] TLS-backends are not mutually exclusive anymore, depending on a platform, more than one TLS backend can be built. E.g., configuring Qt with -openssl does not prevent SecureTransport or Schannel plugin from being built. Fixes: QTBUG-91928 Change-Id: I4c05e32f10179066bee3a518bdfdd6c4b15320c3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Convert QSslSocket(Backend)Private into pluginTimur Pocheptsov2021-03-171-58/+0
| | | | | | | | | | | | | | All backend-specific code is now separated and removed from QSslSocket(Private) code. The original code is mostly preserved to avoid (as much as possible) regressions (and to simplify code-review). Fixes: QTBUG-91173 Task-number: QTBUG-65922 Change-Id: I3ac4ba35d952162c8d6dc62d747cbd62dca0ef78 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 9391ba55149336c395b866b24dc9b844334d50da)
* TLS backend: merge with its factoryTimur Pocheptsov2021-01-281-87/+79
| | | | | | | | | | | | | | QTlsBackend is a factory itself - it creates TLS/X509 objects. Having an intermediary between Factory->Backend->TLS primitive does not look very natural thus let's squash the first two parts. Backend is a factory creating TLS primitives, but its static functions also provide information about backends availablei and give access to those backends. Fixes: QTBUG-90606 Task-number: QTBUG-65922 Change-Id: I8409d81fd11fb46e6ab4465b4937a7680a8c2447 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QSsl: add a new private APITimur Pocheptsov2021-01-221-4/+136
| | | | | | | | | This is an abstraction for TLS backend and its factory, preparing to transition to plugin-based design. Task-number: QTBUG-65922 Change-Id: Ibe810e77fd1b715a6bea66cd3f44312b015ac274 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>