Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.0.2, 5.2.0
-
None
Description
The securesocketclient example can be used to reproduce this issue. http://qt-project.org/doc/qt-5.0/qtnetwork/securesocketclient.html
If one modifies the sslclient.cpp:
void SslClient::secureConnect() { if (!socket) { socket = new QSslSocket(this); connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState))); connect(socket, SIGNAL(encrypted()), this, SLOT(socketEncrypted())); connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>))); connect(socket, SIGNAL(readyRead()), this, SLOT(socketReadyRead())); } socket->setProtocol(QSsl::TlsV1_2); // New/Changed socket->connectToHostEncrypted(form->hostNameEdit->text(), form->portBox->value()); updateEnabledState(); }
You can test wit TLS 1.2-enabled website e.g.:
www.google.com
www.mit.edu
www.yale.edu
www.whitehouse.gov
(Note: OpenSSL 1.0.1+ is required for TLS 1.2 support)
Expected:
The application connects without errors.
Actual:
After this modification, the application does not seem to connect at all, but no errors are shown either.
See the attached screen shots.
Also it should possible to select TLS1.0, TLS1.1 and TLS1.2 (all three) for the allowed protocol (e.g. to exclude SSLv2 and SSLv3). It looks like the current API allows only a single protocol.
Attachments
Issue Links
- relates to
-
QTBUG-40251 QSslSocket::setProtocol() causes SSL context error on Ubuntu 14.04
-
- Closed
-