summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl
Commit message (Collapse)AuthorAgeFilesLines
* cmake: Enable network testLiang Qi2019-07-2915-0/+430
| | | | | | | Task-number: QTBUG-74146 Change-Id: Ib29d1531f89676afb2b4df5032529b731ace029d Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove usages of deprecated APIs from QtAlgorithmsSona Kurazyan2019-06-291-3/+3
| | | | | | | | | | | | | | | | | Task-number: QTBUG-76491 Change-Id: I9dab736a0cbd2e86588919640c26e8ce6b3674d0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-06-252-26/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/gui/painting/qdrawhelper.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/android/qandroidinputcontext.cpp src/widgets/styles/qstylesheetstyle.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
| * Temporarily skip tst_QSslSocket::resumeMårten Nordheim2019-06-241-0/+1
| | | | | | | | | | | | | | | | Will be reverted once ready Change-Id: Id03df7dea1dd65579ec83606fddf2a73a45a0d64 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * SSL: Update an about-to-expire certificateMårten Nordheim2019-06-241-15/+15
| | | | | | | | | | | | Change-Id: I9e29baf529b74ae33fa0ee7250e5af6b1873e86f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * QSslSocket: add and set the TLSv1.3-specific PSK callbackv5.12.4Mårten Nordheim2019-06-121-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If this callback is not set then OpenSSL will call the callback used for <= TLS 1.2 unconditionally when connecting. If using PSK it will call it again later once the preshared key is needed. We don't currently handle the TLSv1.3 PSK, but we definitely should. But for now we can work around it - when psk_use_session_callback is called we simply change the PSK callback to a dummy function whose only purpose is to restore the old callback. This is mostly done to keep behavior the same as it is now for users (and to keep our tests running). Later we can add a new signal and handle this new feature properly. Task-number: QTBUG-67463 Change-Id: I4aca4ae73ec4be7c4f82a85e8864de103f35a834 Reviewed-by: Simo Fält <simo.falt@qt.io>
| * tst_qsslsocket: fix racy testMårten Nordheim2019-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this threaded setup the server can sometimes have the data before it calls "waitForReadyRead", what happens then is that we fail the wait and as a result the test fails overall. Let's check if we actually got some data after all and then continue if we did. Since both the client and the server currently wait the same amount of time (2s) the max timeout for the client was increased by 0.5s so it has some time to notice that the server got the message. Change-Id: Ib5915958853413047aa5a7574712585bcae28f79 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit e79b1dcdf542be3a20d5c21ea163ff857ed875bf) Reviewed-by: Simo Fält <simo.falt@qt.io>
* | Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-141-1/+2
| | | | | | | | | | | | | | | | Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | tests: remove the last uses of Java-style iteratorsMarc Mutz2019-06-131-3/+1
| | | | | | | | | | | | | | | | | | | | | | ... except where they are actually the component under test. Java-style iterators are scheduled for deprecation. Change-Id: If4399f7f74c5ffc0f7e65205e422edfa1d908ee8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Granularize blacklist of qsslsocket for WindowsMårten Nordheim2019-05-101-0/+16
| | | | | | | | | | | | | | | | Using the information from grafana we can unblacklist all the things which are consistently passing. Change-Id: I79917ca9c40e1df2dab46bb54cc0a2bd4a1a4621 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Expose docker test server as an internal config to all modulesRyan Chu2019-04-253-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Before testserver becomes a stable feature, let's keep testserver.prf in "mkspecs/features/unsupported". The test server's shared files will be stored in "mkspecs/features/data/testserver". Because the path of testserver has been changed, all the tests relying on the docker servers should be updated as well. Change-Id: Id2494d2b58ee2a9522d99ae61c6236021506b876 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-03-311-2/+0
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/configure.json Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
| * | Remove blacklisting of tst_qsslsocket_onDemandCertificates_memberAllan Sandfeld Jensen2019-03-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | tst_qsslsocket: fix racy testMårten Nordheim2019-03-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this threaded setup the server can sometimes have the data before it calls "waitForReadyRead", what happens then is that we fail the wait and as a result the test fails overall. Let's check if we actually got some data after all and then continue if we did. Since both the client and the server currently wait the same amount of time (2s) the max timeout for the client was increased by 0.5s so it has some time to notice that the server got the message. Change-Id: Ib5915958853413047aa5a7574712585bcae28f79 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | tst_qsslkey: test AES encryption in the 'encrypt' testMårten Nordheim2019-03-261-18/+74
| | | | | | | | | | | | | | | | | | | | | | | | And export the required symbols in OpenSSL so we can run the test there as well even if it's not needed for any functionality. Change-Id: I4246d2b0bbdd42079d255f97f3c66ce8bb37390b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | WinRT: Add support for AES-encrypted keysMårten Nordheim2019-03-261-2/+2
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-54422 Change-Id: Icbf2b153edacb348e475d6adb9aecb63519874de Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-03-151-2/+2
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-141-2/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qcollator_win.cpp Change-Id: I6d806d7c58b2057ebde3ad915bb5551f34b700e5
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-111-2/+2
| | |\| | | | | | | | | | | | | Change-Id: Iecdf00ca61d819bde532daa42f093860ec4a499e
| | | * Expand blacklisting of tst_qsslkey to cover all versions of RHELsTony Sarajärvi2019-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous blacklisting 5c4e5032b5162341168c1cec09f0247c7f2283e7 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>
* | | | Schannel: support for AES-encrypted keysMårten Nordheim2019-03-151-1/+1
|/ / / | | | | | | | | | | | | | | | | | | Task-number: QTBUG-54422 Change-Id: I7387cdf9ca927c91cccf3dab7d2deb577ce71802 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Convert tst_QSslSocket to work with DockerTimur Pocheptsov2019-03-113-66/+134
| | | | | | | | | | | | | | | | | | | | | Change-Id: Ifb075763e3a0c6c08677dd2ae7febbbc8e4e48a9 Reviewed-by: Ryan Chu <ryan.chu@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | QSslKey - add a support for AES encrypted keysTimur Pocheptsov2019-03-084-5/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for SecureTransport backend. OpenSSL, while reading RSA/DSA, is internally calling EVP_BytesToKey that essentially does the same thing this patch does in 'deriveAesKey' and thus able to correctly decrypt whatever it first encrypted (while generating/ encrypting keys). Fixes: QTBUG-54422 Change-Id: Ia9f7599c5b19bf364c179f2abd2aab7ea5359a65 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | SecureTransport - make 'securetransport' feature publicTimur Pocheptsov2019-03-072-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the current feature disparity, it makes sense to give our users ability to detect if they can use some feature or not in their application code, using our 'modern' QT_CONFIG(securetransport). Accordingly, use this new syntax in our own auto-tests. Change-Id: Ib33b03e7e602e9f8b0db8251377c89dbaada1049 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Extend the test for QSslKeyLars Schmertmann2019-03-021-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check if QSslKey::handle() returns data representing the same key information as that passed to the constructor. Task-number: QTBUG-64495 Change-Id: I1a91264e6f6d92d259b51fca9de00fcbfd5cc845 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Convert tst_qsslsocket_*_static/member auto-testsTimur Pocheptsov2019-03-014-12/+43
|/ / | | | | | | | | | | | | | | To work with docker test server. Change-Id: I50a1c7b632748d7648dafd70356aa849614e4e12 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Schannel: Add ALPN supportMårten Nordheim2019-01-281-3/+19
| | | | | | | | | | | | | | | | [ChangeLog][QtNetwork][SSL] The Schannel backend now supports ALPN and thus HTTP/2. Change-Id: I1819a936ec3c9e0118b9dad12681f791262d4db2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.12' into dev" into ↵Liang Qi2019-01-281-0/+6
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-261-0/+6
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
| | * tst_qsslsocket - blacklist several test temporarilyTimur Pocheptsov2019-01-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QSslSocket: Fix isMatchingHostname when the CN is an IP AddressMårten Nordheim2019-01-282-0/+27
|/ / | | | | | | | | | | | | Change-Id: Id083c1434fcb3a64af40e6f8df720719c1029ca7 Fixes: QTBUG-73289 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | tst_qsslsocket: Make an ALPN test available to other backendsMårten Nordheim2019-01-241-40/+41
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Ssl: Add support for IP-address in alternate subject nameMårten Nordheim2019-01-242-0/+31
| | | | | | | | | | | | | | | | | | | | 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>
* | Schannel supportMårten Nordheim2019-01-223-10/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | disabledProtocol() - use the right address when connectingTimur Pocheptsov2019-01-091-2/+2
| | | | | | | | | | | | | | ... as we normally do in other tests, using localhost. Change-Id: I7969d7bfd50b545adae7e23476d17b6224e9a8fc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QSsl: do not wait for 'connected'/'encrypted' if a protocol is disabledTimur Pocheptsov2018-12-211-44/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | OpenSSL: drop support for SSLv2 and SSLv3Giuseppe D'Angelo2018-12-131-129/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Add tst_QOcsp auto-testTimur Pocheptsov2018-12-0611-0/+1074
| | | | | | | | | | | | | | | | | | 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>
* | Amend 7f77dc84fb to simplify the parameters of createPlainTestRowsLars Schmertmann2018-11-241-3/+3
| | | | | | | | | | Change-Id: I61370a46722f729ea53cb365eab556a97ec5ee7b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Add support for Diffie-Hellman keys to QSslKeyLars Schmertmann2018-11-2314-2/+82
| | | | | | | | | | | | | | | | | | | | | | | | This is necessary to provide details for the key too, when the server is using DHE-RSA-AESxxx-SHAxxx. Amends 7f77dc84fb434f33ffe96f6633792706b80fb0a3. 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>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-221-3/+57
|\| | | | | | | | | | | | | | | | | | | 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
| * Merge remote-tracking branch 'origin/5.12.0' into 5.12Liang Qi2018-11-161-3/+57
| |\ | | | | | | | | | Change-Id: Ic1dd39044e19f50e1068d4ac70dacaad6440e570
| | * Add missing protocol enumerators, report TLS 1.3 if negotiatedTimur Pocheptsov2018-11-071-3/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-101-4/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Make tst_qsslsocket::protocolServerSide() less flakyTimur Pocheptsov2018-11-071-4/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* / tst_QSslSocket: deduplicate datatags and don't cast to intMårten Nordheim2018-10-161-8/+8
|/ | | | | | | | | | | | 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>
* Fix builds without DTLSAllan Sandfeld Jensen2018-10-091-1/+1
| | | | | | | Change-Id: Ic7215c7aa0bf6f7b37ae34649d809f2e1e1ee95b Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_qdtls: add 'invalidConfiguration' testTimur Pocheptsov2018-08-101-0/+15
| | | | | | | | | | Test that we don't silently replace an invalid TLS configuration with the default one (for now, the only thing that is considered to be non-valid - is having non-DTLS protocol set). Change-Id: I6f714b009cf1345a085a3f26d638fc31330f1a94 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDtls: delay protocol version verificationTimur Pocheptsov2018-08-101-6/+0
| | | | | | | | | | | | | | | | | | | A weird behavior of the DTLS server example, when linked with 1.0.2, exposed that client code, requesting an invalid protocol (for example, SSLv3) can end-up with connection encrypted with DTLS 1.2 (which is not that bad, but totally surprising). When we check the protocol version early in setDtlsConfiguration() and find a wrong version, we leave our previous configuration intact and we will use it later during the handshake. This is wrong. So now we let our user set whatever wrong configuration they have and later fail in TLS initialization, saying - 'Unsupported protocol, DTLS was expected'. Auto-test was reduced - the follow-up patch will introduce a new 'invalidConfiguration' auto-test. Change-Id: I9be054c6112eea11b7801a1595aaf1d34329e1d2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Extend 'ignoreExpectedErrors' testTimur Pocheptsov2018-08-021-9/+28
| | | | | | | | | with a case when we fail to ignore/pre-set one of possible verification errors. Change-Id: I23b06243b61acef1ef3576c51529f3ef6601ba7d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>