Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.2
-
None
-
3
-
b13f23d232cfdd372ef812d427872d52eed2337e
-
Foundation Sprint 92, Foundation Sprint 93
Description
As with all Socket + SSL related API, Qt will emit a signal `sslErrors(const QList<QSslError> &)` when connecting to a host where something's off with the certificate. When working with local devices which often have self signed certificates, this signal will be emitted with 2 expected errors: HostNameMismatch and SelfSignedCertificate. An example code to react on this would be:
connect(socket, &Q[Ssl|Web]Socket::sslErrors, this, [=](const QList<QSslError> &sslErrors){ // Verify sslErrors only contains the two expected errors // Pin the certificate fingerprint or verify against previously pinned one // If all went well, accept the self signed certificate socket->ignoreSslErrors(sslErrors); }
Now this works perfectly fine for QSslSocket, however, with QWebSocket this won't work but just calling
socket->ignoreSslErrors()
to ignore all ssl errors does work.
This seems to be a bug as it makes `QWebSocket::ignoreSslErrors(const QList<QSslError> &)` quite useless, no?
Attachments
Issue Links
- relates to
-
QTBUG-102715 QWebSocketServer: peerVerifyError, handshakeInterruptedOnError and sslErrors have very limited use
- Open