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

Can not create Qt websocket server with SSL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.11.1
    • Network: SSL, WebSockets
    • None
    • Windows, MacOS
    • Linux/X11, macOS, Windows

    Description

      Hi cnn

      Qt FW is sort of powerful FW for developing application. So i have moved lots of work to Qt. One of them, I am developing a project which create a websocket server support SSL. I reference to Qt echo websocket server for my project and i also have public key and private key. But i get some issue when implement the project.

      1) On MacOS(10.13), the server have crated and start listening from any port. But i can not open a socket from client (I use websocket client extension on Chrome ) --> connecting state long time. Although I can ping to server successfully but no new connection created. I think that the hand shake get error but i dont know how to debug the process.

      2) On Windows 10, On my machine, the server work well , can create connection and send data but on my friend (Windows 10 ) there are some log shown when open socket as below

      qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_server_method
      qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
      qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
      qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
      qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error

      I also try to config pro file to use openssl library but the solution still not work.

      Could you give some hint to resolve or debug for the case?

      If you need more information, please tell me.

      Many thanks to you

       

      Note: I am using Qt 5.11 community.

      a Snap shot from my code for configuring ssl

      qputenv("QT_SSL_USE_TEMPORARY_KEYCHAIN", QByteArray::number(1));

      QSslCertificate certificate(_cert.toUtf8(), QSsl::Pem);
      QSslKey sslKey(_key.toUtf8(), QSsl::Rsa, QSsl::Pem);
      _sslConfiguration.setPeerVerifyMode(QSslSocket::VerifyNone);
      _sslConfiguration.setLocalCertificate(certificate);
      _sslConfiguration.setPrivateKey(sslKey);
      _sslConfiguration.setProtocol(QSsl::TlsV1SslV3);

      _webSocketServer.setSslConfiguration(_sslConfiguration)

       

       

       

       

       

       

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            ntt2899 Tung Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes