summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-104-11/+18
| | | | | | | | | | And fix up some wrong qmake project files Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 2304acab5ff3bd3832c2e388cfdab27f2a95caa8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QTcpSocket: stabilize connectToHostErrorTimur Pocheptsov2020-12-072-9/+27
| | | | | | | | | | | | | | | | | It's not _wrong_ to time out when connecting to something unreachable (it's just a different way of handling it) so we shouldn't fail when this happens either. In local testing (windows) it times out after 8 seconds, so bump the timer to 10 seconds. On systems where it's faster there'll be no difference as long as things don't go wrong. Fixes: QTBUG-88042 Fixes: QTBUG-89089 Change-Id: I8437cf8e4fbecedea2391ed87fdce1213085b964 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 27f52942b422b47a1283d918e0a0bc8761382921) (cherry picked from commit 4111d8e8e789c815ae37eb9903b042124e169078)
* Http2: Remove errored-out requests from queueMårten Nordheim2020-12-021-12/+0
| | | | | | | | | | | | | | | | | | | The requests will remove themselves once they get deleted but since the deletion is done through a _queued_ invokeMethod to 'deleteLater' we will call QHttpNetworkConnection::_q_startNextRequest first which may end up starting a reconnect of the TCP socket which we had the error on. In this specific instance it manifested as a race condition where we either don't get a proxyAuthorizationRequired signal at all (it was emitted while we didn't have any valid replies), or we get the signal emitted too late and it gets emitted on whatever the next reply was. Task-number: QTBUG-88417 Change-Id: If3f8ececc5550f1868c90124559cb8e3029646d8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 65bcac95a7a051d4343aaa3c5ff8b39494aa14e4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSslConfiguration - improve code coverageTimur Pocheptsov2020-12-012-4/+43
| | | | | | | | | | By adding auto-tests that were missing/not triggering the paths found by LCOV. Change-Id: I472f59e8e7292786c80d7c8dcebde53a2982e1ec Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 1157167a5c69e253fdeb6c8ad532c5d52e150769) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QPasswordDigestor - improve code coverageTimur Pocheptsov2020-12-011-0/+59
| | | | | | | | | | By extending (a bit) an auto-test to cover paths found by LCOV. All of them is just to trigger the code that checks input parameters. Change-Id: I62f9a9045038ff8d123fd1396f4bfd85e75c6d8f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 95cbce3e6e0d8a1e82260cfb5b78491a3906be86) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qtcpserver: Test pauseAccepting/resumeAcceptingMårten Nordheim2020-12-011-0/+33
| | | | | | | | | | | | | Currently untested The socks case is odd: after accepting the first connection it shows as unconnected. Details as for why is unknown, out of scope of adding this test. Change-Id: I0e7658f23b89f3af8db379b001ee33a844f3bec4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 6035fd8f2c23357c46c401fb7120af83e5cf5887) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QDtls(cookie verifier): make sure a server can re-use 'Client Hello'Timur Pocheptsov2020-12-011-0/+14
| | | | | | | | | | | | | | | | And extend an auto-test for this. When a cookie verification mechanism is enabled, and verifier, indeed, verifies that some datagram is a 'Client Hello' message with a proper cookie attached, we start a real DTLS handshake creating a QDtls object and calling 'doHandshake'. In case cookie verification was enabled, we need parameters from the verifier (it's a crypto-strong 'number' and hash algorithm) to 'lock and load' the TLS state machine in a freshly created TLS session object. This code path previously was only tested manually and was found by LCOV as untested. Change-Id: Ieacb8c989997999ea10e15bda6ae106a0338b698 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 6a1d9f6fc1e46f7f0af7ec52dc5d6d415c918bf2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSslSocket::verify: do not alter the default configurationTimur Pocheptsov2020-12-012-2/+96
| | | | | | | | | | | | | | | | | | | | QSslCertificate::verify() has an undocumented and not very desirable property - on some platorms it updates the default configuration, which can be surprising. For example, we deprecated QSslSocket::setDefaultCaCertificates() and recommend using QSslConfiguration::defaultConfiguration(), QSslConfiguration::setDefaultConfiguration(), and QSslConfiguration::setCaCertificates(). If an application does this to select CA roots it trusts explicitly, and then for some reason is calling verify, the application can have its QSslSockets successfully connecting to a host, whose root was not trusted by the application. Also, on Windows, defaultCaCertificates() include system roots already, no need to have them twice. [ChangeLog][QtCore][QtNetwork] QSslSocket::verify - do not change the default configuration Fixes: QTBUG-88639 Change-Id: I1cd40b259d0a6dcd15c78d1e7c027ff10859595c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 1158ff67b492853b72199ed78bfcf24132e1c7ff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QSslError: improve the code coverage, as pointed at by LCOVTimur Pocheptsov2020-12-013-38/+98
| | | | | | | | | | | | | And also, reduce the utter sloppiness, weirdness of the test and make it more a test and not a joke. Since the test itself depends on !QT_NO_SSL, why bother building and running its main, to create a useless tst_QSslError and do nothing then? Exclude test from no-ssl build. Change-Id: I67879b0de036cbc8c2f75a18f4cf94e6c43c5af0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit fe009bd51438877d864d2444f40582508c43c1f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist authenticationCacheAfterCancel on Ubuntu 20.04Alexandru Croitor2020-11-241-0/+4
| | | | | | | | | | | | | | It flaky fails integrations. Amends 2b49b01aa3467173f0be9252cfa50b41a311dd57 Task-number: QTBUG-88417 Change-Id: I6aad6ee7a70e580da64e75f69e8c9cab1cb78cd7 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 143d619ba33c693fbbf9fbc3587921a44ae87435) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSslCipher - improve its code coverage and auto-testsTimur Pocheptsov2020-11-202-23/+25
| | | | | | | | | | | | | tst_qsslcipher was quite useless - now we test that default constructed QSslCipher reports expected values. Test the non-default from the different auto-test, where we are sure we have really useful ciphersuites (with different parameters obtained from a TLS backend, where it's possible). Change-Id: Iff14a0580fed889cf9e0873bee01d968773626db Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 1a2e2921d268f09b6cb5ca91c85614192b8e2e0e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qocsp: improve code coverageTimur Pocheptsov2020-11-201-3/+16
| | | | | | | | | | By simply extending the basic test to trigger qHash, isEqual and a bunch of getters. Change-Id: Ib1d88fc6d2ad623743cea77ac286ae6ac819dfd1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 1d7189f5b3eb03e7c71fb31e2bd491d0e5a535e4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Allow QWindowsPipe{Reader,Writer} to work with foreign event loops"Kai Koehne2020-11-201-3/+2
| | | | | | | | | | | | | | This reverts commit ee122077b09430da54ca09750589b37326a22d85. Reason for revert: This causes QProcess::readAll() to sometimes return nothing after the process has ended. Fixes: QTBUG-88624 Change-Id: I34fa27ae7fb38cc7c3a1e8eb2fdae2a5775584c2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 23100ee61e33680d20f934dcbc96b57e8da29bf9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Get rid of Q_COMPILER_CONSTEXPR checksAllan Sandfeld Jensen2020-11-171-4/+0
| | | | | | | Is required now. Change-Id: I62e95929d1649ea1390392230b619bd56d2a0349 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow QWindowsPipe{Reader,Writer} to work with foreign event loopsAlex Trotsenko2020-11-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a foreign event loop that does not enter an alertable wait state is running (which is also the case when a native dialog window is modal), pipe handlers would freeze temporarily due to their APC callbacks not being invoked. We address this problem by moving the I/O callbacks to the Windows thread pool, and only posting completion events to the main loop from there. That makes the actual I/O completely independent from any main loop, while the signal delivery works also with foreign loops (because Qt event delivery uses Windows messages, which foreign loops typically handle correctly). As a nice side effect, performance (and in particular scalability) is improved. Several other approaches have been tried: 1) Using QWinEventNotifier was about a quarter slower and scaled much worse. Additionally, it also required a rather egregious hack to handle the (pathological) case of a single thread talking to both ends of a QLocalSocket synchronously. 2) Queuing APCs from the thread pool to the main thread and also posting wake-up events to its event loop, and handling I/O on the main thread; this performed roughly like this solution , but scaled half as well, and the separate wake-up path was still deemed hacky. 3) Only posting wake-up events to the main thread from the thread pool, and still handling I/O on the main thread; this still performed comparably to 2), and the pathological case was not handled at all. 4) Using this approach for reads and that of 3) for writes was slightly faster with big amounts of data, but scaled slightly worse, and the diverging implementations were deemed not desirable. Fixes: QTBUG-64443 Change-Id: I1cd87c07db39f3b46a2683ce236d7eb67b5be549 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Blacklist authenticationCacheAfterCancel on Ubuntu 20.04Andreas Buhr2020-11-131-0/+5
| | | | | | | | | | The test authenticationCacheAfterCancel was the only one to fail in recent COIN runs. This patch blacklists it on Ubuntu 20.04. Task-number: QTBUG-88417 Change-Id: Idc85499da82336d291d9a90ecb941810a0e6c935 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_qsslkey - handle QT_NO_SSL properlyTimur Pocheptsov2020-11-131-0/+4
| | | | | | | | | | | | The recent change handling missing elliptic curves introduced a problem for '-no-ssl' configuration/build. The first version had some protection, but it was openssl-specific and required a private feature, thus was removed. Now the real ifdef must be with QT_NO_SSL Fixes: QTBUG-88238 Pick-to: 5.15 Change-Id: I6fba26d6ab63850e1468e76f8b234703255a026c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update public suffix list header to latest versionEdward Welbourne2020-11-081-1/+2
| | | | | | | | | The former *.platform.sh entry has been replaced by more specific entries, replacing the wildcard with only selected second levels. Task-number: QTBUG-87925 Change-Id: Ie4ba7c66ba9aa40eafe23f02faa12f19d791cff2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use built-in C++ foreach iteration in testsDavid Skoland2020-11-061-5/+5
| | | | | Change-Id: I1e4bf9249ce26c034c676d78cfa16231226da05b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Android: blacklist a list of failing tests for androidAssam Boudjelthia2020-11-046-4/+31
| | | | | | | | | | | | | | | | We want to re-enable Android tests in QTQAINFRA-3867. However, many tests are failing already preventing that from happening. QTBUG-87025 is currently keeping track (links) to all of those failing tests. The current proposal is to hide those failing tests, and enable Android test running in COIN for other tests. After, that try to fix them one by one, and at the same time we can make sure no more failing tests go unnoticed. Task-number: QTBUG-87025 Change-Id: Ic1fe9fdd167cbcfd99efce9a09c69c344a36bbe4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* tests: blacklist tst_QTcpSocket::connectToHostError()Liang Qi2020-10-301-1/+2
| | | | | | | | on Ubuntu 20.04. Task-number: QTBUG-88042 Change-Id: Ie63cd26b6885b73073251e20cb4e8ba5da36d906 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tests: blacklist tst_QUdpSocket::multicast() on CentOSLiang Qi2020-10-281-0/+2
| | | | | | Task-number: QTBUG-84254 Change-Id: Icf50e7c85a0434ecdf29ae70776b274789b9eb45 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Make Ubuntu with its non-standard security level happyTimur Pocheptsov2020-10-262-88/+84
| | | | | | | | | | | Ubuntu changed the default level from 1 to 2 and not accepting our RSA 1024 anymore. While we are not testing the TLS library's strength, we re-generate a ceritficiate to shut the thing (the botched, 'fixed' OpenSSL) up for good. Task-number: QTBUG-86187 Change-Id: I6151ce5210972ae938e52731157742910363afbe Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix tst_qsslkey to compile when SSL is disabledFriedemann Kleint2020-10-232-3/+5
| | | | | | | | Move it to the section requiring SSL tests since it requires QSslConfiguration. Change-Id: I5c807976ce75fa5967bddb8edd7788dbfbb89375 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-231-1/+1
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix and run the qlocalsocket autotest with cmake buildLars Knoll2020-10-233-32/+13
| | | | | Change-Id: I79691fe97e1373ffdc6a1b9b929f8a3fc2ef863d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QSslSocket (autotest) - defuse a time bombTimur Pocheptsov2020-10-161-13/+16
| | | | | | | | | | | Interesting, it only exploded now - initially we were too fast (faster than 500 ms) so never noticed. Now that more tests with the similar event loop handling were introduced, the last one was catching a single-shot timer signal, accessing long dead object). Fixes: QTBUG-87612 Change-Id: I52446fa7b08ef90a4742af3662da7837a8602941 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QLocalSocket/Win: prevent writing to broken pipeAlex Trotsenko2020-10-151-0/+1
| | | | | | | | | | | | When a peer closes the connection, the device remains opened for reading purposes. However, we should disable writing on disconnected socket. Otherwise, if the user issues a write() call, a new pipe writer object will be created and the write call occurs with invalid handle value. Pick-to: 5.15 Change-Id: Id136798c7663df1fce7ed0aa4e3c6f5c65218a11 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Schannel: TLS1.3 supportMårten Nordheim2020-10-141-20/+32
| | | | | | | | | | | | | | | | | | | | | | It's not possible to connect to microsoft.com with Schannel TLS 1.3 for some reason (also tested with Internet Explorer), but other sites work fine. Must be something they have to iron out for later. In my experience this needs a preview release of Windows. One of my machines is opted into the dev channel of Windows where they enabled TLS 1.3 by default, and it works well in my tests except for the part above. On my other machine, after enabling TLS 1.3 through the registry, I fail to complete the handshake with any site. So around March/April next year is when this code would activate for most people. MinGW apparently defines NTDDI_VERSION as the one for Windows Server 2003, so it currently doesn't build the new TLS 1.3 code. In Qt (as a project) we could consider setting this higher, but that's out of scope for this patch! Fixes: QTBUG-81294 Change-Id: If329959c3a30ecbfbb8c0d335cc39ccb6d012890 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_QTcpSocket::connectToHostError - increase the timeoutTimur Pocheptsov2020-10-081-4/+5
| | | | | | | | | | | As suggested by the message from QTestLib. This, indeed, fixed the sadistic test. Also, make sure resources are not leaked. Pick-to: 5.15 Fixes: QTBUG-87009 Change-Id: Id693a5a562ea5ebacc853e5fc0ab9654ba851e72 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-078-17/+17
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add test case for QSslSocket to show the wrong behaviorLars Schmertmann2020-10-025-0/+373
| | | | | | | Task-number: QTBUG-81661 Change-Id: I4ed2ad3a22bd5439751328d915e9984eb89397d1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Further blacklist network tests on Windows MinGWTony Sarajärvi2020-09-291-0/+48
| | | | | | Task-number: QTBUG-87009 Change-Id: Ic855ae87b69c02f76519a2957de05f4af7bf9a6d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Blacklist QTcpSocket::connectToHostErrors in Windows 10 buildsTony Sarajärvi2020-09-291-1/+2
| | | | | | Task-number: QTBUG-87009 Change-Id: I63c1bcb77a359cea82f2831b02f1e29b46060a66 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Blacklist tst_QUdpSocket::writeDatagramToNonExistingPeerHeikki Halmet2020-09-291-4/+1
| | | | | | | | | | | tst_QUdpSocket::writeDatagramToNonExistingPeer is also failing with MinGW Task-number: QTBUG-74542 Task-number: QTBUG-80328 Change-Id: I44b886a1fc1eac34deefc34690c6701063a49d8f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-2368-82/+82
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QDecompressHelper: limit decompression ratioMårten Nordheim2020-09-222-0/+6
| | | | | | | | To avoid potential decompression bombs. This is implemented with just a simple check that the ratio doesn't pass some hardcoded preset. Change-Id: I17246f0f43e73280cdb35a8f03d65885f5678ad6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Regenerate projectsAlexandru Croitor2020-09-228-0/+219
| | | | | | | | | Clean up the state of the projects, before changing the internal CMake API function names. Task-number: QTBUG-86815 Change-Id: I90f1b21b8ae4439a4a293872c3bb728dab44a50d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake Build: Add qtnetwork docker testserver supportCristian Adam2020-09-1711-0/+11
| | | | | | | | | | | | | | | qt_add_test supports now QT_TEST_SERVER_LIST, which will add the test servers as docker test fixtures. The docker server will be started before the test is run, and stopped after the test is run. Running the tests in parallel is not supported. Docker tests are currently only supported on Linux hosts. Task-number: QTBUG-85034 Change-Id: If3cefe05c5dec19c14b05d2fa8b01a0b6d95e259 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Schannel: Properly handle request for certificateMårten Nordheim2020-09-141-8/+0
| | | | | | | | | | | | | | Certain servers, like smtp.live.com, will send a request for a certificate even though they don't require one. In Schannel this manifests as a warning/info status (SEC_I_INCOMPLETE_CREDENTIALS). In the cases where it's not needed we should suppress the warning and try to connect anyway, which is done by calling InitializeSecurityContext again when we get the status. Pick-to: 5.15 Change-Id: I3c48140f2949d8557251a49a2b66946da9395736 Reviewed-by: Joshua GPBeta <studiocghibli@gmail.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix compiler warnings about missing overridesLars Knoll2020-09-131-1/+1
| | | | | Change-Id: I52bf9fe45607f4a99cafa441bd78dfe5f7adb0e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSsl: workaround a 'very secure' OpenSSL version (CentOS 8.x et al)Timur Pocheptsov2020-09-124-1/+32
| | | | | | | | | | | | | CentOS it seems not only backported some OpenSSL 3 functions, but also raised the default security level to 2, making some of our keys (and MDs?) 'too weak' and failing auto-tests here and there as a result. For our auto-test we lower the level to 1, as it is expected to be. Fixes: QTBUG-86336 Pick-to: 5.15 Change-Id: I7062a1b292e8b60eb9c2b2e82bd002f09f9da603 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QAuthenticator: condition using GSSAPI on credentials availabilityMårten Nordheim2020-09-111-3/+3
| | | | | | | | | | | | AFAICT with GSSAPI the normal workflow is to run kinit or similar and authenticate before running programs relying on it. Therefore we can try to get the credentials before we choose whether or not to use Negotiate. Pick-to: 5.15 Task-number: QTBUG-85123 Change-Id: If0478fdd45389b2939ad87c2f582776fe56959bb Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_QNetworkReply: Avoid race in ioGetFromHttpWithAuthMårten Nordheim2020-09-111-1/+5
| | | | | | | | | | | | | | | | | | | | | Our authentication code is race-y by design: 1. When two requests are fired off and queued at the same time in the same QHttpNetworkConnection then if one of them encounters "authentication required" then it will copy whatever credentials it got to all the other channels in the connection. This is likely what the first part of the test is testing. 2. If a later request is fired off and it includes credentials in the url then the newly included credentials should be used instead of the cached ones. The race here can occurr when one socket either takes too long to connect or the connected signal is not received early enough. Then the first socket is used for both requests and then we can hit case #2 when the url contains credentials. Pick-to: 5.15 Change-Id: I646a5378d8c1256b2de98b51912953df29f68cb2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove most compiler warnings about missing overridesLars Knoll2020-09-1111-56/+56
| | | | | | | | | | | | Remove around 1000 compiler warnings about missing overrides in our auto tests. This significantly reduce the compiler warning noise in our auto tests, so that one can actually better see the real problems inbetween. Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix a rather sloppy test case in tst_QSslKeyTimur Pocheptsov2020-09-101-6/+51
| | | | | | | | | | | | It's not guaranteed that all curves we want to use are supported by a specific build of OpenSSL library we have to link with. Filter out files that contain EC, which is not among the curves, reported by QSslConfiguration::supportedEllipticCurves. Fixes: QTBUG-46203 Pick-to: 5.15 Change-Id: I70d7e6fcacb3d81f8c771e4a8d6cca06295e7474 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Extend test blacklisting from Ubuntu 18.04 to 20.04Tor Arne Vestbø2020-09-031-0/+1
| | | | | | Task-number: QTBUG-86187 Change-Id: I3ac3233f7355d1c16bc9bf6e052fdf4bd9ea90de Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove QFtp sources etc. in favor of alternate distributionMårten Nordheim2020-08-2710-3371/+102
| | | | | | | | | | | | While we initially wanted to just disable the functionality the way it is currently built forces people to do a full build of Qt just to enable it. Instead of doing this half-measure let's just remove the code completely from QtBase and rather prepare QtNetwork to handle being a plugin that can be compiled at any time. Task-number: QTBUG-80340 Change-Id: I19155c8c167cf932088f01b2a9706d0e7ab792d1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* tst_QNetworkDiskCache: fix setCookieHeaderMårten Nordheim2020-08-251-0/+5
| | | | | | | | | | | It wouldn't grab the cached entry since it was not deemed "fresh" (and would never be fresh because we didn't know when it originated from or when it expired). But the test still passed because the reply produced a "finished" signal which ended the loop, but the "finished" signal was due to an error which was unchecked. Change-Id: I6ad271aa621bdb4a48b74bc8fd64c7e2caa8f179 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Disable cipherstring-setting test for schannelMårten Nordheim2020-08-241-0/+4
| | | | | | | And put a note about it in the documentation Change-Id: I29126e4a80f83c256190e03b8fe01f3c869fd46d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>