Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103780

QWebSocket::ignoreSslErrors(const QList<QSslError> &) not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.12, 5.15, 6.2
    • 5.15.2
    • WebSockets
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              oyheskes Øystein Heskestad
              mzanetti2 Michael Zanetti
              Vladimir Minenko Vladimir Minenko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes