Commit Graph

1017 Commits

Author SHA1 Message Date
Timur Pocheptsov
91ab70d17f tst_qnetworkreply - QSKIP/disable tests that deadlock on Windows
We use global object to store errors found by q_X509Callback.
Thus, we also use a lock/mutex. It would appear all tests
involving in-process server and QNAM are prone to intermittent
failures on our Windows VMs - it's always about timeouts due
to the client socket (QNAM) locking and the server socket blocking
main thread while trying to acquire the same lock.

The real fix is to get rid of global variable/locking, we'll
have it later (quite a change and requires a lot of accuracy).

Task-number: QTBUG-76247
Change-Id: Iffc90d9e16783f17f62e836e01c35f22681bdd39
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-07 06:39:16 +02:00
Qt Forward Merge Bot
ff88e20b83 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I44eda44bf424fdcffab048a2534905d6162e5559
2019-04-10 01:00:08 +02:00
Timur Pocheptsov
4b445481c3 tst_http2 - extend 'singleRequest' test case
to test different h2 modes: "h2c" (clear text with protocol upgrade),
"h2" (encrypted, negotiating via ALPN extension), "h2-direct" (encrypted,
no ALPN), "h2c-direct" (plain text, no protocol upgrade). This patch-set
is  an amendment to the recent fix in the protocol handler where we were
crashing in "h2c-direct" mode.

Change-Id: I3ff5ed1396a59b72b59a95f927d404ccd202d0b8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-04-09 04:08:01 +00:00
Qt Forward Merge Bot
ce7f14d2e0 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iec860bb703f983b7438e67c695b9c454e72b3e0f
2019-04-06 01:00:08 +02:00
Volker Hilsheimer
7935d86e7d Populate test data for reverse lookups using system tools
Hardcoding IP addresses and their respective DNS records is fragile.
We care about Qt producing the same result as other DNS querying tools,
so testing that instead.

Running a python script for this is easiest, and assumed to be quite
reliable.

In case where python fails/is not present, fall back to nslookup.
That tool is available on Linux, macOS, and Windows, although the
output it produces varies. This change implements very basic
line-parsing that can interpret the various results encountered
during testing on those platforms.

This also reverts commit bbaceff253fae13d8e56691bc9de7e1981db5118,
which blacklisted the tests that failed due to changes in DNS
records.

Use the opportunity to replace usage of gitorious.org.

Change-Id: I967de226bd603c805df7fe3ed4e871d92d2d0750
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-04-05 05:50:18 +00:00
Qt Forward Merge Bot
0a7302abbc Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I9935bacae0d6ba532418fc3d28adbc7ca1463604
2019-03-30 01:00:07 +01:00
Volker Hilsheimer
743e883c12 Blacklist the reverse lookup of 8.8.8.8 to unblock integrations
The DNS entry for the host has changed, dig answers with dns.google,
not with google-public-dns-a.google.com. While developing a proper
fix to the test, blacklisting this particular lookup allows
integrations to pass in the meantime.

Change-Id: Id37da6b24554803bf4e2c84be5b949ded40566e8
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-03-29 13:45:47 +00:00
Allan Sandfeld Jensen
a0446b1398 Remove blacklisting of tst_qsslsocket_onDemandCertificates_member
It is constantly passing according to grafana.

Change-Id: I4953cd54e27adde8dad79e9a0f025960802e6c7a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-03-27 16:57:06 +00:00
Friedemann Kleint
8f1acd29e4 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I71cc71881fb638e207d83a8733bad8f267701c0f
2019-03-26 08:27:02 +01:00
Mårten Nordheim
9e61cec791 Network cache: Stop treating no-cache like no-store
In the QNetworkAccessManager machinery we would treat "no-cache" as if
it meant "don't cache" while in reality it means "don't return these
cached elements without making sure they're up-to-date"

At the same time as this change is made let's add test data for
"no-store", which replaces the "no-cache" test data.

Fixes: QTBUG-71896
Change-Id: Ieda98f3982884ccc839cac2420c777968c786f6e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2019-03-22 13:25:54 +00:00
Qt Forward Merge Bot
0a02de62d1 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iecdf00ca61d819bde532daa42f093860ec4a499e
2019-03-11 01:00:06 +01:00
Tony Sarajärvi
912bcf0f0d Expand blacklisting of tst_qsslkey to cover all versions of RHELs
Previous blacklisting 5c4e5032b5 only
covered RHEL 6.6 and RHEL 7.4. The problem however exists in all
6.x and 7.x distros as they have the same openssl.

This however leaves us the problem with future RHEL 8. This will
keep blacklisting these tests there as well. We need a way to blacklist
versions with a wildcard so that we could say RHEL-7.*

Task-number: QTBUG-46203
Change-Id: I2cc52ba2eac949214ecaa02e19d9e623d5befc49
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-03-10 14:08:21 +00:00
Liang Qi
2add2dbdaa Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/network/access/http2/hpacktable_p.h

Change-Id: Ie0c296667dfdebba84f4858056a1ac80c24ee7df
2019-03-06 12:31:50 +01:00
Timur Pocheptsov
ef5aefb062 Hpack - fix the static lookup
'accept' breaks the order, making the static table unsorted and thus
std::lower_bound cannot find it and we always index it in a dynamic
table. Also, make this static table accessible to auto-test.
Plus fix some warnings quite annoyingly visible in qt-creator.

Fixes: QTBUG-74161
Change-Id: I47410f2ef974ac92797c9804aa55cb5c36a436c4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-03-04 16:18:14 +00:00
Qt Forward Merge Bot
64085d9b2f Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I9e7cb1b131b7b216aad8ed1b1536669fd1557c21
2019-02-22 01:00:27 +01:00
Timur Pocheptsov
d3eb9e944a Make tst_QUdpSocket::lincLocalIPv6 less sadistic
It fails on CI (Windows 10). Given our qabstractsocket disables
read notifications/stops emitting readyRead if it already has pending data
(unbuffered, aka UDP socket type) - make sure we do not suffer from this.
The change does not affect the test's logic (unless the logic was to fail),
it just makes it more fail-proof.

Change-Id: I6c9b7ded20478f675260872a2a7032b4f356f197
Fixes: QTBUG-73884
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-02-21 11:14:48 +00:00
Qt Forward Merge Bot
0c0c4a23bc Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I830beea26863323ab78a5d4b093f7763d77ad3da
2019-02-21 01:00:08 +01:00
Timur Pocheptsov
3a1a97dabe tst_http2::earlyResponse - fix a flaky and somewhat broken test
1. Fix erroneous logic, which was triggered in 'h2' mode (non-TLS connection)
- after the initial protocol upgrade/POST request was handled, the server
(on Windows specifically) was erroneously handling upcoming DATA frames by replying
with another redirect response.
2. Make the test less heavy by sending 1 MB of Qt::Uninitialize instead of 10 MB
- theoretically this could cause a timeout before the redirected request finished
successfully.

Task-number: QTBUG-73873
Change-Id: I961e0a5f50252988edd46d0e73baf96ee22eef3f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-02-20 08:43:48 +00:00
Qt Forward Merge Bot
67c70b22f6 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0
2019-02-19 01:00:08 +01:00
Joerg Bornemann
8fe3680193 Add cmdline feature to qmake
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".

Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-02-18 07:12:14 +00:00
Mårten Nordheim
698078680f Schannel: Add ALPN support
[ChangeLog][QtNetwork][SSL] The Schannel backend now supports ALPN and
thus HTTP/2.

Change-Id: I1819a936ec3c9e0118b9dad12681f791262d4db2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-01-28 21:35:11 +00:00
Liang Qi
e3621dd6bd Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2019-01-28 19:30:32 +00:00
Ryan Chu
71cd5a6f36 Select single-name SSL certificate for test servers using host network
On Windows and macOS, the containers are deployed into a virtual
machine using the host network. All the containers share the same
hostname (qt-test-server), and they are connected to the same network
domain (local).

When running test in such platforms, use the single-name SSL certificate
(qt-test-server.local) for SSL related tests.

Change-Id: Idf33e01e8dd8814510d848b87b59b5fc0edc903e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-28 14:03:34 +00:00
Mårten Nordheim
d8d60696da QSslSocket: Fix isMatchingHostname when the CN is an IP Address
Change-Id: Id083c1434fcb3a64af40e6f8df720719c1029ca7
Fixes: QTBUG-73289
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-01-28 14:03:30 +00:00
Liang Qi
980567b3a3 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/android/templates/AndroidManifest.xml
	tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp

Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
2019-01-26 08:35:40 +01:00
Timur Pocheptsov
a90a238b49 tst_qsslsocket - blacklist several test temporarily
For some reason behavior of SecureTransport has changed from 10.12 to 10.13
and then to 10.14. On 10.13 SecureTransport fails upon receiving the server's
certificate with 'Unrecoverable error', before we can do a manual verification
and accept the certificate as trusted. Analysis of available source code
shows that they, apparently, do not like MD5 hash which our server is using.
Until certificate is updated on the server or we switch completely to
the Docker-based solution we have to BLACKLIST tests that connect to our
current network test-server. Oddly enough, on 10.14 SecureTransport is
less mean.

Task-number: QTBUG-69873
Change-Id: I7da1883e0970a2f6ddd8385f193b76116d6983e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-24 20:38:14 +00:00
Mårten Nordheim
fe1907435d tst_qsslsocket: Make an ALPN test available to other backends
Currently only available for the OpenSSL backend to use but doesn't
actually rely on anything OpenSSL specific.

Move it so it can be used by the Schannel backend in an upcoming patch

Change-Id: Ia29b153bf3f29cff0d62a41ec5dd7d4671a18095
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-24 15:24:23 +00:00
Mårten Nordheim
58c9c4b609 Ssl: Add support for IP-address in alternate subject name
While it's not common it still occurs, perhaps especially with 127.0.0.1

Can be tested by attempting to connect to https://1.1.1.1/ using Qt.

Change-Id: Idad56476597ab570b8347236ff700fa66ab5b1f4
Fixes: QTBUG-71828
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-01-24 15:24:14 +00:00
Mårten Nordheim
7cc6f78dd4 Schannel support
Adds support for Schannel, an SSL backend for Windows, as an
alternative to OpenSSL.

[ChangeLog][QtNetwork][Ssl] Added support for Schannel on Desktop
Windows. To build Qt with Schannel support use '-schannel' during
configure.

Task-number: QTBUG-62637
Change-Id: Ic4fb8ed3657dab994f9f4a4ac5cbddc7001a0a46
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-01-22 15:19:48 +00:00
Timur Pocheptsov
0cc9c30479 disabledProtocol() - use the right address when connecting
... as we normally do in other tests, using localhost.

Change-Id: I7969d7bfd50b545adae7e23476d17b6224e9a8fc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-01-09 05:36:45 +00:00
Ryan Chu
574ac8734d Skip smb-path test of tst_QNetworkReply when using Docker test servers
The tests of smb protocol only work in the CI network. Therefore,
the docker-based test server for Windows can't pass all the tests of
QNetworkReply.

These two tests should be reworked when adding Samba server to the
docker-based test servers later on.

Task-number: QTBUG-72861
Change-Id: I54e639b5414760ee929d0d28fe10f9e021aff7dc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-08 22:28:34 +00:00
Timur Pocheptsov
3e1758e35d QSsl: do not wait for 'connected'/'encrypted' if a protocol is disabled
since we'll refuse to continue with a handshake, failing in initSslContext()
on a disabled protocol versions. Then, functions like waitForEncrypted,
connectToHostEncrypted, startServerEncryption and startClientEncryption
should either bail out early (who needs a TCP connection which we'll
abort anyway?) or bail out whenever we can, as soon as a disabled protocol
was found in a configuration. This change also makes the behavior
of different back-ends consistent, since it's a general code-path
that reports the same SslInvalidUserData error. Update auto-test to
... actually test what it claims it tests.

Task-number: QTBUG-72196
Task-number: QTBUG-72179
Change-Id: I548468993410f10c07ce5773b78f38132be8e3e0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-21 03:28:47 +00:00
Giuseppe D'Angelo
455951f590 OpenSSL: drop support for SSLv2 and SSLv3
As per RFC 6176 (2011) and RFC 7568 (2015).

Code-wise, we're left with the decision of what to do with a few
enumerators in QSsl::Protocol; I've made TlsV1SslV3 act as TlsV1,
and adjusted the description of AnyProtocol.
A new test was introduced - deprecatedProtocol() - to test that
we, indeed, do not allow use of SSL v2 and v3. protocol() and
protocolServerSide() were reduced to exclude the (now) no-op
and meaningless tests - neither client nor server side can
start a handshake now, since we bail out early in initSslContext().

[ChangeLog][QtNetwork][SSL] Support for SSLv2 and SSLv3
sockets has been dropped, as per RFC 6176 (2011)
and RFC 7568 (2015).

Change-Id: I2fe4e8c3e82adf7aa10d4bdc9e3f7b8c299f77b6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-12-13 15:59:37 +00:00
Timur Pocheptsov
6a28f67677 Add tst_QOcsp auto-test
This patch introduces a private 'API' to enable server-side OCSP responses
and implements a simple OCSP responder, tests OCSP status on a client
side (the test is pretty basic, but for now should suffice).

Change-Id: I4c6cacd4a1b949dd0ef5e6b59322fb0967d02120
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-12-06 05:14:45 +00:00
Liang Qi
5d5c00c676 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/gui/painting/qdrawhelper.cpp

Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
2018-12-04 09:58:43 +01:00
Qt Forward Merge Bot
1b5bbacdb0 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
2018-11-27 01:00:09 +01:00
Sami Nurmenniemi
71bd06d516 Make developer build tests pass for boot2qt
Some tests were fixed and others were skipped/blacklisted.

Task-number: QTBUG-63152
Change-Id: Ica7df555f8d152ee589865911130525101d4b941
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-11-26 07:06:59 +00:00
Lars Schmertmann
079df681ec Amend 7f77dc84fb to simplify the parameters of createPlainTestRows
Change-Id: I61370a46722f729ea53cb365eab556a97ec5ee7b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-24 07:15:16 +00:00
Lars Schmertmann
de83447830 Add support for Diffie-Hellman keys to QSslKey
This is necessary to provide details for the key too,
when the server is using DHE-RSA-AESxxx-SHAxxx.
Amends 7f77dc84fb.

Change-Id: I8ab15b6987c17c857f54bc368df3c6c1818f428c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-23 22:58:05 +00:00
Liang Qi
bf58c70546 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/io/qdir.cpp
	src/corelib/kernel/qtimer.cpp
	src/corelib/kernel/qtimer.h

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
2018-11-22 01:53:29 +01:00
Liang Qi
41cba737a9 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I909c9cfa0ce80f512de4b4986e626eae66b63afa
2018-11-21 19:34:18 +01:00
Liang Qi
46076f7333 tst_QNetworkReply: Blacklist getFromHttp:success-external
Task-number: QTBUG-71953
Change-Id: I449ee3be8fa748046895386c9cbff90b30ed80c4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-21 16:02:52 +00:00
Liang Qi
37d3bc9ad7 Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: Ic1dd39044e19f50e1068d4ac70dacaad6440e570
2018-11-16 08:10:15 +01:00
Liang Qi
58437fb125 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/serialization/qcborcommon.h
	src/corelib/tools/qlocale_data_p.h
	tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
2018-11-10 11:38:40 +01:00
Timur Pocheptsov
d786c55b9e Make tst_qsslsocket::protocolServerSide() less flaky
By accident, when we erroneously tried testing TlsV1_3 on macOS with
SecureTransport (which does not support TLS 1.3) we hit this quite
subtle problem: it can happen that a server-side socket is never
created but a client (after TCP connection was established) fails
in TLS initialization and ... stops the loop preventing
SslServer::incomingConnection() from creating its socket. Then we
dereference nullptr.

Task-number: QTBUG-71638
Change-Id: I8dc5a4c53022a25aafe2c80a6931087517a48441
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-07 12:25:12 +00:00
Timur Pocheptsov
b3ae87fe76 Add missing protocol enumerators, report TLS 1.3 if negotiated
1. Remove the conditional inclusion of DTLS versions, they made difficult
and unnecessary ugly adding new protocols (something like TlsV1_2OrLater + 4).

2. OpenSSL 1.1.1 first introduced TLS 1.3 support. OpenSSL 1.1 back-end is
compatible with OpenSSL 1.1.1, but would fail to extract/report protocol
versions and set versions like 'TLS 1.3 only' or 'TLS 1.3 or better' on a
new context.  Given 1.1.1 is deployed/adapted fast by different distros,
and 5.12 is LTS, we fix this issue by introducing QSsl::Tls1_3 and
QSsl::Tls1_3OrLater.

SecureTransport, WinRT and OpenSSL below 1.1.1 will report an error in case
the application requests this protocol (SecureTransport in future will
probably enable TLS 1.3).

Saying all that, TLS 1.3 support is experimental in QSslSocket.

Done-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Done-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: I4a97cc789b62763763cf41c44157ef0a9fd6cbec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-07 10:32:35 +00:00
Qt Forward Merge Bot
f09fc1f352 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I6f8d3abd3247dc980dc7834801a017a89c8f4286
2018-11-01 01:01:28 +01:00
Timur Pocheptsov
321f11db53 tst_QLocalSocket::processConnections: remove QSKIP
on macOS, the test seems to be stable nowadays.

Task-number: QTBUG-39986
Change-Id: I18430c3feb27a5bee5474e1eb95f7d89b25f00a9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-10-25 11:51:48 +00:00
Mårten Nordheim
1859a76090 tst_QSslSocket: deduplicate datatags and don't cast to int
Some of the enums were cast to int on comparison. That just makes it
harder to know what the values were.

And verifyClientCertificate had 4 cases which were named the same as 4
others.

Change-Id: I09e8e346a6f416236a92073cf9a8f349938d37ef
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-10-16 10:45:41 +00:00
Qt Forward Merge Bot
fedcaf0256 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I2715ee7c694e5579bcedc7bab0ae68e79d5fd0b6
2018-10-13 00:07:20 +02:00