Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Using OpenSSL/Secure Websockets with Qt WebAssembly
Forum Updated to NodeBB v4.3 + New Features

Using OpenSSL/Secure Websockets with Qt WebAssembly

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
5 Posts 4 Posters 1.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pgmQt
    wrote on last edited by
    #1

    PROBLEM STATEMENT:

    Need to create an example Client-Server application using WebAssembly and secure websockets.
    Client GUI App:
    A simple C++ based GUI based on Qt Webassembly. The Gui pages are served from a webserver
    hosted on the same host as the Server App. To launch the client GUI in the web browser we have to use secure protocol (https://).
    Once the GUI is launched, it communicates with the Server App by establishing secure wesocket connection and sends messages back and forth.

    Server App:
    Made of a C++ application. This server will listen to Secure Websocket Connections from the client Gui.
    Once Wesocket connections are established, it must accept commands from the client and provide response.

    Client & Server test environment:
    Must be built on Ubuntu 22.04
    Built using Qt 6.5.0

    Webassembly Notes:
    https://doc-snapshots.qt.io/qt6-6.5/wasm.html

    Qt Wesockets Notes:
    https://doc-snapshots.qt.io/qt6-6.5/qwebsocket.html
    https://doc.qt.io/qt-6/qtwebsockets-examples.html

    What is desired:
    Qt Example Client project with full source code
    Qt Example Server project with full source code
    Webserver configuration files and notes. Prefers NGINX webserver
    If Qt Webassembly has to be rebuilt from source, Notes with complete qt rebuild instructions.
    Notes on how to incorporate Qt's OpenSSL libraries to the Client Gui and how to setup the SSL keys between Client/Server

    sierdzioS 1 Reply Last reply
    0
    • P pgmQt

      PROBLEM STATEMENT:

      Need to create an example Client-Server application using WebAssembly and secure websockets.
      Client GUI App:
      A simple C++ based GUI based on Qt Webassembly. The Gui pages are served from a webserver
      hosted on the same host as the Server App. To launch the client GUI in the web browser we have to use secure protocol (https://).
      Once the GUI is launched, it communicates with the Server App by establishing secure wesocket connection and sends messages back and forth.

      Server App:
      Made of a C++ application. This server will listen to Secure Websocket Connections from the client Gui.
      Once Wesocket connections are established, it must accept commands from the client and provide response.

      Client & Server test environment:
      Must be built on Ubuntu 22.04
      Built using Qt 6.5.0

      Webassembly Notes:
      https://doc-snapshots.qt.io/qt6-6.5/wasm.html

      Qt Wesockets Notes:
      https://doc-snapshots.qt.io/qt6-6.5/qwebsocket.html
      https://doc.qt.io/qt-6/qtwebsockets-examples.html

      What is desired:
      Qt Example Client project with full source code
      Qt Example Server project with full source code
      Webserver configuration files and notes. Prefers NGINX webserver
      If Qt Webassembly has to be rebuilt from source, Notes with complete qt rebuild instructions.
      Notes on how to incorporate Qt's OpenSSL libraries to the Client Gui and how to setup the SSL keys between Client/Server

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      So, you want somebody else to do the task for you? And then you will land a nice job? ;-)

      Anyway, just wanted to say I did use secure web sockets in WASM in a project a few years ago so it is possible. WASM runs in a browser which already supports Open SSL so using wss:// simply just works if I recall correctly.

      Looks like a basic web sockets example from Qt would satisfy the requirements here.

      (Z(:^

      P 1 Reply Last reply
      2
      • sierdzioS sierdzio

        So, you want somebody else to do the task for you? And then you will land a nice job? ;-)

        Anyway, just wanted to say I did use secure web sockets in WASM in a project a few years ago so it is possible. WASM runs in a browser which already supports Open SSL so using wss:// simply just works if I recall correctly.

        Looks like a basic web sockets example from Qt would satisfy the requirements here.

        P Offline
        P Offline
        pgmQt
        wrote on last edited by
        #3

        @sierdzio In my initial attempt, It looks like the problem I encountered was similar to what the other person described here;
        https://forum.qt.io/topic/137581/two-major-problem-that-prevent-qt-webassembly-used-in-real-project

        Item #1 in his/her list.

        1 Reply Last reply
        0
        • lorn.potterL Offline
          lorn.potterL Offline
          lorn.potter
          wrote on last edited by lorn.potter
          #4

          @pgmQt
          WebAssmebly uses the browsers ssl stack. Just feed to https:// url

          Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
          Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

          1 Reply Last reply
          1
          • D Offline
            D Offline
            DalePennington
            wrote last edited by DalePennington
            #5

            I am having a similar issue. I have a WebAssembly app using Websockets to communication from the WebAssembly app in the client computer browser to an app on the host computer. Works fine with normal http, but we want to go to https.

            I tried to use the sslechoserver and sslechoclient sample apps in the QtWebSockets example area, but while they work when compiled with normal Qt, when I try to compile the sslechoclient in Qt for WebAssembly (Qt 6.10), I get errors because SSL is not supported. I get the impression you had a possible solution above, but I do not really understand what it was.

            Do I just use the normal echoclient (built in QtWebAssembly) requesting a wss URL combined with host sslechoserver with the same cert that the web server provides ?

            Thanks for the help
            Dale Pennington

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved