diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-16 12:31:58 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-16 12:32:56 (GMT) |
commit | 5c48202a1a3618e71a56d957f0170827543dd3f3 (patch) | |
tree | acd16c441aeda5b3cab39b5b7b0e5e1573d4c475 | |
parent | dc0d84ac8f797eaf1d74cd82cda1aab04b0e5f87 (diff) | |
download | Qt-5c48202a1a3618e71a56d957f0170827543dd3f3.zip Qt-5c48202a1a3618e71a56d957f0170827543dd3f3.tar.gz Qt-5c48202a1a3618e71a56d957f0170827543dd3f3.tar.bz2 |
Fix SSL connection problem.
You can't do connectToHost followed by startClientEncryption followed by write.
-rw-r--r-- | tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp index c35cdeb..f9f2730 100644 --- a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp +++ b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp @@ -305,11 +305,12 @@ void tst_NetworkRemoteStressTest::sequentialRemoteHosts() } else { socket = QSharedPointer<QTcpSocket>(new QTcpSocket); } - socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); if (isHttps) { static_cast<QSslSocket *>(socket.data())->setProtocol(QSsl::TlsV1); - static_cast<QSslSocket *>(socket.data())->startClientEncryption(); + static_cast<QSslSocket *>(socket.data())->connectToHostEncrypted(url.host(), url.port(443)); static_cast<QSslSocket *>(socket.data())->ignoreSslErrors(); + } else { + socket->connectToHost(url.host(), url.port(80)); } socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" @@ -375,11 +376,12 @@ void tst_NetworkRemoteStressTest::parallelRemoteHosts() socket = new QSslSocket; else socket = new QTcpSocket; - socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); if (isHttps) { static_cast<QSslSocket *>(socket)->setProtocol(QSsl::TlsV1); - static_cast<QSslSocket *>(socket)->startClientEncryption(); + static_cast<QSslSocket *>(socket)->connectToHostEncrypted(url.host(), url.port(443)); static_cast<QSslSocket *>(socket)->ignoreSslErrors(); + } else { + socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); } socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" |