summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* Convert features.ftp to QT_[REQUIRE_]CONFIGStephan Binner2017-09-0611-36/+31
| | | | | | | | QUrlInfo is used only by the FTP implementation, so it uses the same conditionals. Change-Id: Ia15abf44d2a538e90b792a31c65926cc9e16aecf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Forward the readChannelFinished from the plain socket to the ssl socketAlbert Astals Cid2017-09-013-0/+14
| | | | | | Task-number: QTBUG-62257 Change-Id: I12632b7ffd2012adc99b4784892cbb6f79e065f7 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Fix crashes with libproxy+webkitgtk: it's not threadsafeThiago Macieira2017-08-272-25/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | I'm getting crashes in Akonadi processes due to libproxy. I don't have direct evidence that this was caused by a threading condition, but it's clear from the source code of libproxy that the plugins it runs for expanding PAC scripts are not thread-safe. To overcome this problem, we only run libproxy functions in one thread only. #0 0x00007f745f0ac1d8 in JSC::HeapTimer::timerDidFire() () at /usr/lib64/libjavascriptcoregtk-4.0.so.18 #1 0x00007f745f0ac287 in () at /usr/lib64/libjavascriptcoregtk-4.0.so.18 #2 0x00007f748e5ae9c5 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0 #3 0x00007f748e5aed88 in () at /usr/lib64/libglib-2.0.so.0 #4 0x00007f748e5aee1c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #5 0x00007f7494f4268f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #6 0x00007f7494eeb35a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #7 0x00007f7494d1b31a in QThread::exec() () at /usr/lib64/libQt5Core.so.5 #8 0x00007f7494d1fd2e in () at /usr/lib64/libQt5Core.so.5 #9 0x00007f74913174e7 in start_thread () at /lib64/libpthread.so.0 The pacrunner implementation of libproxy uses libdbus-1 which (officially) is thread-safe, but experience tells that it has problems. Since it is not running a JS engine, we don't need a thread, but we do need to lock around it. Change-Id: I84e45059a888497fb55ffffd14d2f638f21e807d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QHostInfo: Remove Darwin refusal to use getnameinfo(3)Thiago Macieira2017-08-241-2/+1
| | | | | | | | | | | | | | | | | This #if has been there since 0248ec4054b (Oct 2005), presumably due to bugs reported after the Qt 4.0 release (the first containing QHostInfo). Any macOS issues with getnameinfo() have long since been gone. I've confirmed that it works on 10.9, 10.10, 10.11 and 10.12, so I'm dropping the #ifndef. [ChangeLog][Deprecation Notice] Starting with Qt 5.10, IPv6 support will be mandatory for all platforms. Systems without proper IPv6 support, such as the getaddrinfo() function or the proper socket address structures, will not be able to build QtNetwork anymore. Change-Id: I320d9d2f42284a69a4cbfffd14dd5bf479e5f678 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkInterface: Fold the test for if_nameindex into the config testThiago Macieira2017-08-242-6/+2
| | | | | | | | No need to make workarounds for Android in the .cpp source. Just let it fail (if it still has to fail). Change-Id: Iaf4157b7efa2416d898cfffd14d94ebcb4d979be Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Avoid dereferencing nullptrMårten Nordheim2017-08-181-1/+1
| | | | | | Change-Id: Id9558fa1db6a7a8f29149e26c761450f58b74b81 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix crash when reading a PKCS12 file with no private keyEdward Welbourne2017-08-172-1/+4
| | | | | | | | | | | | | | | | | | The only reason our code wants PKCS12 files is for a private key, but a valid file needn't contain one; and reading a file without lead to a crash in QSslKeyPrivate::fromEVP_PKEY(). So check for missing key and fail the load, since the file is useless to us. Also ensure the caller's pkey is initialized, as we aren't promised that PKCS12_parse() will set it when there is no private key. Add a test for this case (it crashes without the fix) and update the instructions for how to generate test data to cover it also. (Corrected the wording there, too; at the interactive prompt, "providing no password" really provides an empty password.) Task-number: QTBUG-62335 Change-Id: I617508b903f6d9dee40d539b7136b0be8bc2c747 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Check for loopback address if network access is unavailableMårten Nordheim2017-08-151-2/+10
| | | | | | | | | A loopback address warrants the same exception as local files. Task-number: QTBUG-59219 Change-Id: Ie0a75faa558d6596455da38656c8749c994d0fd8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNAM: requeue pipelined HTTP requests after unrecoverable socket errorsRomain Pokrzywka2017-08-141-2/+5
| | | | | | | | | | | | If we reach the maximum reconnect attempts for an HTTP request with pipelining enabled, those also need to be requeued during cleanup for the connection channel. Otherwise future successful requests on that same channel will incorrectly assign the data to replies from the old pipelined requests, resulting in swapped data in the replies. Task-number: QTBUG-62286 Change-Id: I804b8ac280957b518d63b2341e469a13315a8c27 Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* Fix write and read-write ioctls on certain 64-bit OSThiago Macieira2017-08-101-1/+1
| | | | | | | | | | | | | Using int as the operation parameter was wrong. It meant any write or RW ioctls (which have the MSB set) would be sign-extended to 64-bit when calling the native API. Depending on the OS, the upper 32 bits were not cleared prior to comparing with the call number, resulting in unexpected errors. Linux and FreeBSD operated properly; I only got the error on Darwin. Change-Id: Iaf4157b7efa2416d898cfffd14d985af65c1ff89 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* configure: un-namespace remaining non-inline configure testsOswald Buddenhagen2017-08-021-3/+3
| | | | | | | only few tests remain, and many of these were mis-classified anyway. Change-Id: Ic3bc96928a0c79fe77b9ec10e6508d4822f18df2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* configure: Add a feature to write tests in the .json fileThiago Macieira2017-08-021-5/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're adding a lot of unnecessary files that end up later as cargo-cult, for at most a handful of lines. So instead move the testcases directly into the .json file. The following sources were not inlined, because multiple tests share them, and the inlining infra does not support that (yet): - avx512 - openssl - gnu-libiconv/sun-libiconv (there is also a command line option to select the exact variant, which makes it hard/impossible to properly coalesce the library sources) The following sources were not inlined because of "complications": - verifyspec contains a lengthy function in the project file - stl contains lots of code in the source file - xlocalescanprint includes a private header from the source tree via a relative path, which we can't do, as the test's physical location is variable. - corewlan uses objective c++, which the inline system doesn't support reduce_relocs and reduce_exports now create libraries with main(), which is weird enough, but doesn't hurt. Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: Ic3a088f9f08a4fd7ae91fffd14ce8a262021cca0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix bytesAvailable() on UDP under WindowsAlex Trotsenko2017-07-301-1/+4
| | | | | | | | | | | | | | When ::WSAIoctl() reports 1 byte available for reading, we are trying to peek an incoming datagram to ensure that the data is actually delivered. But, according to MSDN docs, we are not allowed to pass NULL as 'lpNumberOfBytesRecvd' parameter to ::WSARecvFrom() call, if 'lpOverlapped' parameter is also NULL. The case with an empty datagram is fixed accordingly. Change-Id: Id13038245332d3fb4bc18038d44a7cfd7ce04775 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compilation failing for WinRT with QT_NO_SSLMårten Nordheim2017-07-271-1/+1
| | | | | | | | Change-Id: I5a2758065d3155f4f33b76c022c43955a9b096c2 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QAsn1Element - fix toDateTime functionTimur Pocheptsov2017-07-181-3/+31
| | | | | | | | | | | | | ASN UTCTime uses two characters to encode a year (YY). When converting it into QDate, it's quite naive to just add 2000. According to RFC 2459, these YY represent dates in the range [1950, 2049]. This patch also introduces a helper function doing the checked conversion from a string to int (to be reused in the following-up patches). Task-number: QTBUG-61934 Change-Id: I3f6f471d24e8357b83b2f5973023b2b842751389 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Convert features.localserver to QT_[REQUIRE_]CONFIGTimur Pocheptsov2017-07-059-65/+33
| | | | | | | | | | Move all the logic into socket.pri and clean-up source code. Build local socket/server only if feature 'localserver' was enabled. Task-number: QTBUG-61672 Change-Id: I9f9d1a262df4bb020c8706c7cb5a66b926e0240f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QSslSocket - fix two memory management issues (Secure Transport)Timur Pocheptsov2017-07-041-2/+2
| | | | | | | | | | | | | I noticed we never release 'items' imported by SecPKCS12Import. But looking at the actual code (SecImportExport.c), it appears we own these 'items' and must release them. And this leads to a crash (on over-release) which reveals another bug: a value from a dictionary obtained with 'Get' method should follow the 'get rule' - we do not own it and QCFType RAII object is not needed. Change-Id: I219015fadedb256c401e50cf7e955f3d7e0a6c5f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Respect the application and system configuration settings for the proxyAndy Shaw2017-06-301-1/+1
| | | | | | | | | | | | | | If an application proxy has been set or the usage of the system proxy configuration has been turned off then these should be respected rather than querying the system for the proxy. By using proxyForQuery() over systemProxyForQuery() it ensures that it first checks if there is an application proxy set before falling back to the system proxy, if using the system proxy has not been turned off. Task-number: QTBUG-61692 Change-Id: I65ed3e6bd7b3449cd4ae3757e583aa8d7724221b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNativeSocketEnginePrivate::nativeAccept(): Add missing breakFriedemann Kleint2017-06-281-0/+1
| | | | | | | | | Fixes GCC 7 warning: socket\qnativesocketengine_win.cpp:888:21: warning: this statement may fall through [-Wimplicit-fallthrough=] Change-Id: Idb4dce511b3ab634339ac1283d88def283a92028 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* winrt: Fix build for Windows Kit 10.0.10586.0Oliver Wolff2017-06-281-5/+4
| | | | | | | | The old SDK does not consider the macro value a constant expression, so the build fails. Change-Id: I95bdcd9ad34ee4da81016ff07e70439ed229f853 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* qsslsocket_mac - check that SecCertificateRef is not nullTimur Pocheptsov2017-06-131-2/+4
| | | | | | | | | | | | | | | | That's the only place there we can potentially pass a null pointer to CFArrayAppendValue (all other calls are conditionally-protected). This results in (surprise! ... ?) Objective-C exception (while we call something that is a pure-C API). So far we cannot reproduce this crash and can only speculate: probably this happens with invalid (can be either really invalid or the result of our generic QSslCertificate's failure to read/ parse)) custom CA certificates appended to a QSslConfiguration object by applications using QSslSocket/QNAM. The fix will probably make a handshake to fail, but this seems to be better than a crash anyway. Task-number: QTBUG-58213 Change-Id: Ie4f9ab2138bc383adc9f9ed55ed61be2d3cf7020 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Tweak documentation about a default QHostAddressKai Koehne2017-06-121-6/+10
| | | | | Change-Id: I78deb7156900a3a0e79890062a40752b5d2561c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Document QHostAddress::swapKai Koehne2017-06-121-0/+8
| | | | | | Change-Id: I0f47ffeb1a7dbda7dadbd78b2ea04167c42a503d Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Ssl socket - fix broken certificate verificationTimur Pocheptsov2017-06-021-2/+25
| | | | | | | | | | | | | | | On iOS QSslConfiguration always has an empty list of system CA certificates. Calling SecTrustSetAnchorCertificatesOnly(.., TRUE) on iOS results in SecTrustEvaluate failing to verify a valid certificate, since there are no 'anchors' at all. We can use SecTrustSetAnchorCerificatesOnly(.. TRUE) on macOS only, where we do extract/copy system certificates using SecTrustSettingsCopyCertificates and save them in a QSslConfiguration's list. Task-number: QTBUG-61053 Change-Id: I70d4e46273d78414baaac8531273def707c3eebc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* winrt: Get rid of one deferral when handling socket dataOliver Wolff2017-06-022-30/+10
| | | | | | | | | | | | | | | | | Instead of defering one more time by emitting the signal, we can add the data to the list of available data/pending datagrams. For TCP readNotification can be invoked directly so that emission of the readyRead signal is tightly coupled to the availability of new data. For UDP sockets calling readNotification directly stops handling of more data and thus cannot be done. With the old approach it was possible, that the last bit of TCP data was lost, because the socket was closed while the data was still being processed/transferred from the worker to the engine. Task-number: QTBUG-61078 Change-Id: I9330b87876be853d310dc9e8e817ab344939d5dd Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* QSslCertificate: don't init() if SSL is not supportedJüri Valdmann2017-05-301-2/+3
| | | | | | | | | QSslCertificate used SSL without checking if SSL is available. This patch adds such checks to the constructors. Change-Id: Iea298aded5966641327e22e41ad4665a3d0ec5d3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* winrt: Move handling of new socket connections into workerOliver Wolff2017-05-232-151/+166
| | | | | | | | | | | | Same as with receiving data, the "newConnection callback" might be triggered late and cause a crash if it accesses data of a destroyed object. By moving the handling of this callback to a worker without much logic we can prevent these late callbacks from doing any harm. The signals are no longer connected and thus do not trigger any problems. Change-Id: Ic61584f12a46506abe12d7b21403d0c0970c0aae Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* QSslSocket (OpenSSL) make supportsSsl return false, if v >= 1.1Timur Pocheptsov2017-05-211-1/+10
| | | | | | | | | | | | | | | | Our OpenSSL backend allows missing symbols and in general protected from possible related failures. Unfortunately, for OpenSSL 1.1 this means not only missing symbols (removed functions), but new incompatible opaque data-structures and our 1.0 code trying to use them and probably accessing some data-members via macros - we end up in UB and crashes. SSLeay, which returns a version number, was removed in 1.1. A failure to resolve this symbol we consider as a version mismatch and we make 'supportsSsl' to return false. Task-number: QTCREATORBUG-18137 Change-Id: I5cd270f9c61a729105149779ee7277816f9467d7 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: Remove platform support table for bearer managementKai Koehne2017-05-121-28/+1
| | | | | | | | | | The table is woefully outdated. Instead of shipping stale documentation I think it's better to just reference the generic API for this. Change-Id: I619113ab5140ccf65b774e69e836b27001bb0a18 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Use QNetworkReply::ProtocolFailure in HTTP/2 failuresThiago Macieira2017-05-081-4/+4
| | | | | | | | | ProtocolInvalidOperationError are meant for actual replies from the server indicating that the operation is not valid (HTTP 400 Bad Request). Change-Id: I9ad33fff8b634979bdbafffd14bbc57e4b21d6bf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix build without features.networkproxyTasuku Suzuki2017-04-282-3/+10
| | | | | | Change-Id: Ie0868b2d2ec30513e870861514b252a79dff4998 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QSslSocket (SecureTransport) - use anchors only from QSslConfigurationTimur Pocheptsov2017-04-261-1/+2
| | | | | | | | | | | | | | Calling SecTrustSetAnchorCertificatesOnly(trust, false) we actually extend what our user provided in QSslConfiguration as CA certificates (caCertificates, setCaCertificates) - Secure Transport will also use a default set provided by the system and SSL handshake can surprisingly (for a user) succeed. And the default content of these caCertificates, if not altered by setCaCertificates call - are those system CA certificates. Task-number: QTBUG-60233 Change-Id: I8c1094bb7eec260f5202a47085f9f75e720eda7b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: correct \sa statementNico Vertriest2017-04-211-3/+1
| | | | | | | qnetworkreply.cpp:307: warning: Can't link to 'QNetworkRequest::UserVerifiedRedirectsPolicy' Change-Id: Ic96f834f3ca9984f626833e45e69f6322b83d12d Reviewed-by: Martin Smith <martin.smith@qt.io>
* Move Q_REQUIRED_RESULT to its correct positionThiago Macieira2017-04-201-2/+2
| | | | | | | | | | | That's before the return type or static, inline, constexpr or such keywords (if any). Perl Script: s/^(\s+)(.*) Q_REQUIRED_RESULT(;)?(\s*\/\/.*)?$/\1Q_REQUIRED_RESULT \2\3\4/ Change-Id: I7814054a102a407d876ffffd14b6a16182f159e2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QNetworkReplyHttpImpl - check 'isOpen' twiceTimur Pocheptsov2017-04-191-0/+6
| | | | | | | | | | | | A signal emitted after the first 'isOpen' check on QNetworkReply can trigger a slot that aborts/closes our reply. So before we can append any data to reply's buffer, we have to re-check that we're still open. Task-number: QTBUG-59909 Change-Id: I781d5a4fd5fc30d485af63f45cf36c254378af64 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: add missing doc for parametersNico Vertriest2017-04-182-5/+5
| | | | | | | | | qhstspolicy.cpp:105: warning: Undocumented parameter 'flags' in QHstsPolicy::QHstsPolicy() qhstspolicy.cpp:105: warning: No such parameter 'includeSubDomains' in QHstsPolicy::QHstsPolicy() qnetworkaccessmanager.cpp:732: warning: Undocumented parameter 'knownHosts' in QNetworkAccessManager::addStrictTransportSecurityHosts() Change-Id: I24217d328df12febab30e19e2abd351e87007959 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-121-1/+1
|\ | | | | | | Change-Id: I3bd83a839b16822035ed56a5cffe77bd6bc3f08d
| * Fix reusing FTP connection after abortJesus Fernandez2017-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | The QNetworkAccessCache was keeping the connection alive and it was trying to reuse it for subsequent calls to download files from the same server. After closing the connection, it is not usable anymore and a new one should be created. Task-number: QTBUG-40368 Change-Id: I1a0d08956a94eb36f39d14112cdcab6c1e2add82 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Make networkAccessibility() return the actual state of the networkAndy Shaw2017-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | If networkAccessibility() was queried when the networkAccessibleChanged signal was emitted then it would report the wrong state and in some instances it would incorrectly report NotAccessible. This ensures that it is reflecting what the signal would have been emitted with. Change-Id: Ib0a7ef9e9ec42c9007340020fd535c8ad36caa49 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Fix GCC warning about dereferencing type-punned pointersThiago Macieira2017-04-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC is wrong. Type-punning is when you read something of a given type as something else. We're not doing that, as it's only read as integer. qnativesocketengine_unix.cpp:1011:79: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] Too bad my plan for a good C++ solution was foiled by glibc developers. Change-Id: I27b55fdf514247549455fffd14b1a27667745e94 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Fix build when SCTP is enabledThiago Macieira2017-04-061-0/+4
| | | | | | | | | | | | | | | | c0157a9f035a27a3ba20cab0ca3ca1c6e78f0b14 was incomplete. Change-Id: I27b55fdf514247549455fffd14b158f54403663d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QNetworkRequest - do not set ManualRedirectPolicyTimur Pocheptsov2017-04-041-4/+2
| | | | | | | | | | | | | | | | | | | | | | If QNAM's general policy is 'Manual' and QNetworkRequest has neither policy set not FollowRedirectAttribute - do NOT set this 'Manual' policy - its implicitly implied. This fixes previously unnoticed auto test failure (was blacklisted) and also makes QNetworkRequest::operator == work correctly. Change-Id: If17c9af4baf8a470659f82d1a40488078ea8ede0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Allow Secure Transport backend to use a temporary keychainTimur Pocheptsov2017-04-042-6/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cherry picked: this change was first merged into dev, but now we also need it in 5.9 to enable SSL socket tests on the new CI VMs (macOS 10.11, 10.12). As we do not merge dev->5.9, we need this cherry-pick. Since day one Secure Transport socket has two annoying problems on macOS: when we call SecPKCS12Import, we indeed import certs and keys into the default keychain and also (which is more serious) later a dialog can pop up, asking for permission to use a private key (this is especially annoying if you're running SSL autotests or have a server application). Apparently, it's possible to work around those problems if we create our own (temporary) keychain and pass it in the 'options' parameter to SecPKCS12Import. [ChangeLog][QtNetwork] Allow QSslSocket to use a temporary keychain on macOS. Task-number: QTBUG-56102 Change-Id: Ic3a56c905100dc80d907a25fe6ebfa232dcf5b9e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 17927392cf1cecb20cef7cb9cd77131391de087c) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Fix build without features.networkinterfaceTasuku Suzuki2017-04-042-0/+6
| | | | | | | | | | Change-Id: I9fd2a7ec402a1d2d99e30f08554d86f18c6424ff Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Prefer rvalue versions of toLatin() and toUtf8()Anton Kudryavtsev2017-03-302-2/+2
| | | | | | | | | | | | | | ... to re-use existing buffers. Change-Id: I7c42529b8cd4400520a59e658ab76f4f8e965cd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use HTTP2WasUsedAttribute for HTTP2Timur Pocheptsov2017-03-293-2/+14
| | | | | | | | | | | | | | | | | | | | | | Previously we were always setting SpdyWasUsedAttribute for SPDY/HTTP/2/HTTP/1.1 (true/false) which is confusing. Now if HTTP2AllowedAttribute was set to true on a request, we set HTTP2WasUsedAttribute. Otherwise, as we did before, we're setting SpdyWasUsedAttribute. Change-Id: I0c44cfb5469fef0c12719baa951197ee2accee4a Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Use case-insensitive compare moreAnton Kudryavtsev2017-03-291-1/+1
| | | | | | | | | | | | | | | | ... to avoid allocations. Change-Id: I5993633d1509495ff6ce3a11274a53504aac7c5e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-272-7/+21
|\| | | | | | | Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
| * QSslSocket: fix connection to a international domain nameOlivier Goffart2017-03-232-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC6125 section 6.4.2 specify we need to convert the IDN to ascii before comparison. Note that we don't need to toLower anymore because toAce takes care of it. Section 7.2 recommands that we dod not attempt to check for wildcard character embedded within the A-labels or U-labels of an internationalized domain name. So we reject names that contiains a '*' but starts with 'xn--'. Change-Id: Ib0830520a1f82bbf9fd11818718277a479527ee3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-214-38/+71
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/eglfs/eglfs-plugin.pro Change-Id: Id76cdbb41b7758572a3b8ea4dcb40d49bac968db