From 5c48202a1a3618e71a56d957f0170827543dd3f3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 16 Apr 2010 14:31:58 +0200 Subject: Fix SSL connection problem. You can't do connectToHost followed by startClientEncryption followed by write. --- .../tst_network_remote_stresstest.cpp | 10 ++++++---- 1 file 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(new QTcpSocket); } - socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); if (isHttps) { static_cast(socket.data())->setProtocol(QSsl::TlsV1); - static_cast(socket.data())->startClientEncryption(); + static_cast(socket.data())->connectToHostEncrypted(url.host(), url.port(443)); static_cast(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(socket)->setProtocol(QSsl::TlsV1); - static_cast(socket)->startClientEncryption(); + static_cast(socket)->connectToHostEncrypted(url.host(), url.port(443)); static_cast(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" -- cgit v0.12