Forums

OverviewFelgo 2 Support (Qt 5) › Support of webassembly and ssl

Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #22128

    NgapWei

    Qt5.13.1 support webassembly, although not every functions work yet.

    My questions are

     

    1. Qt5.13.1, I think it do not support ssl, what would you do with it if you want to support wasm?
    2. Which version of Felgo would begin to support wasm?

     

    Thanks

    #22156

    Alex
    Felgo Team

    Hi,

    Qt 5.13.1 does support SSL (as well as 5.13.0), it requires OpenSSL 1.1.1 to be precise.

    We want to make sure that WASM is in a usable state when we add it to the stable release of Felgo, we are already testing its features and limits intensively and hope to announce a public release soon. I would love to give you an exact ETA but unfortunately this is not yet final.

    Cheers,
    Alex

    #22205

    NgapWei

    Thanks, but prebuild version of Qt5.13.1, do not support openSSL, you can try to include the “QSslConfiguration” in your codes, then you will see a lot of compile time error. However, you can use javascript to communicate with https protocol, not mature yet, but work.

    #22595

    Jake

    Alex,

    Is Webassembly ready in Felgo yet?

    Is there an example of building an App to it?

    Thanks, Jake

     

    #22603

    Alex
    Felgo Team

    Hi Jake,

    we’re still improving the overall WASM experience and applying several improvements to use Felgo with WASM for production apps. Stay tuned for early next year!

    Cheers,
    Alex

    #22644

    Jake

    Hi Alex,

    Thank you for the update.

     

    Jake

    #22691

    NgapWei

    Nice to hear that, there are two bugs of Qt for webassembly, hope they are solved when you are ready.

    jira 78825

    jira 78826

    #23359

    Nicola

    Any news about SSL support? I think it’s a must for rest webapplication

    #23360

    NgapWei

    niqt said:

    Any news about SSL support? I think it’s a must for rest webapplication

     

    Yes, from Alex

     

    “For WASM, SSL is actually handled by the browser, so SSL is supported. If you need a special SSL setting or certificate, this needs to be handled by your website that wraps the WASM application.”

     

    Please check this post for more details.

    #23361

    Nicola

    When i compile my project in webassembly i have errors:

    ../Felgo/Felgo/wasm_32/include/QtCore/qstring.h:1291:38: note: in implicit copy constructor for ‘QCharRef’ first required here
    { Q_ASSERT(i >= 0); detach(); return QCharRef(*this, i); }
    ^
    ../src/neateat/main.cpp:21:5: error: unknown type name ‘QSslConfiguration’
    QSslConfiguration sslConf = QSslConfiguration::defaultConfiguration();
    ^
    ../src/neateat/main.cpp:21:33: error: use of undeclared identifier ‘QSslConfiguration’
    QSslConfiguration sslConf = QSslConfiguration::defaultConfiguration();
    ^
    ../src/neateat/main.cpp:22:31: error: use of undeclared identifier ‘QSslSocket’
    sslConf.setPeerVerifyMode(QSslSocket::VerifyNone);
    ^
    ../src/neateat/main.cpp:24:5: error: use of undeclared identifier ‘QSslConfiguration’
    QSslConfiguration::setDefaultConfiguration(sslConf);
    ^

    #23363

    NgapWei

    niqt said:

    When i compile my project in webassembly i have errors:

    ../Felgo/Felgo/wasm_32/include/QtCore/qstring.h:1291:38: note: in implicit copy constructor for ‘QCharRef’ first required here
    { Q_ASSERT(i >= 0); detach(); return QCharRef(*this, i); }
    ^
    ../src/neateat/main.cpp:21:5: error: unknown type name ‘QSslConfiguration’
    QSslConfiguration sslConf = QSslConfiguration::defaultConfiguration();
    ^
    ../src/neateat/main.cpp:21:33: error: use of undeclared identifier ‘QSslConfiguration’
    QSslConfiguration sslConf = QSslConfiguration::defaultConfiguration();
    ^
    ../src/neateat/main.cpp:22:31: error: use of undeclared identifier ‘QSslSocket’
    sslConf.setPeerVerifyMode(QSslSocket::VerifyNone);
    ^
    ../src/neateat/main.cpp:24:5: error: use of undeclared identifier ‘QSslConfiguration’
    QSslConfiguration::setDefaultConfiguration(sslConf);
    ^

     

    Expected behavior

     

    from Alex

    “For WASM, SSL is actually handled by the browser, so SSL is supported. If you need a special SSL setting or certificate, this needs to be handled by your website that wraps the WASM application.”

    #23381

    Miguel Rodriguez
    Felgo Team

    Hello Nicola

    You can use the preprocessor directive to skip your SSL specific code for wasm.

    #ifndef Q_OS_WASM
     //your SSL code
    #endif

    All the peer validation is done by the browser for you using well known CA.  Any specific request/SSL setup required should be handled in the browser Javascript code, by adding the http request manipulation code inside the script tag, for example to avoid CORS restrictions you can manipulate the request and add cors-anywhere proxy https://github.com/Rob–W/cors-anywhere#client

    (function() {
        var cors_api_host = 'cors-anywhere.herokuapp.com';
        var cors_api_url = 'https://' + cors_api_host + '/';
        var slice = [].slice;
        var origin = window.location.protocol + '//' + window.location.host;
        var open = XMLHttpRequest.prototype.open;
        XMLHttpRequest.prototype.open = function() {
            var args = slice.call(arguments);
            var targetOrigin = /^https?:\/\/([^\/]+)/i.exec(args[1]);
            if (targetOrigin && targetOrigin[0].toLowerCase() !== origin &&
                targetOrigin[1] !== cors_api_host) {
                args[1] = cors_api_url + args[1];
            }
            return open.apply(this, args);
        };
    })();

     

    Hope this helps.

    Regards.

    #23383

    Nicola

    Thanks

Viewing 13 posts - 1 through 13 (of 13 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support