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

QWebSocketServer::SslMode collision

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.8.0
    • 5.8.0 Alpha
    • WebSockets
    • None
    • a5c85e3250a10a8e23ce15f9a6811136f6bb23fd

      There is such code here:

          enum SslMode {
      #ifndef QT_NO_SSL
              SecureMode,
      #endif
              NonSecureMode
          };

      It means, that the value of NonSecureMode enumerator depends on QT_NO_SSL. If Qt is built with QT_NO_SSL defined, NonSecureMode is equal to 0, otherwise it is equal to 1.

      It causes the annoying collision. Lets we have the following code in our program:

      QWebSocketServer *server = new QWebSocketServer("TestServer", QWebSocketServer::NonSecureMode);

      If we build it with Qt, built with QT_NO_SSL defined, the value of SslMode in out server is equal to 0. If we run this program with such Qt, it works ok.

      But if we try to execute the same program with Qt, built without QT_NO_SSL defined (i.e. where SecureMode is equal to 0), the server "thinks", that it is run in secure mode. As a result such server tries to work with QSslSocket instead of QTcpSocket as we want.

      SUGGESTION
      I think one should make the following definition of SslMode enumeration:

          enum SslMode {
              SecureMode,
              NonSecureMode
          };

      It gets rid the described collision.

        For Gerrit Dashboard: QTBUG-56129
        # Subject Branch Project Status CR V

            aleksey_lysenko Aleksey Lysenko
            fundaev Sergei Fundaev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes