Forums

OverviewV-Play 2 Support (Qt 5) › XMLHttpRequest ssl get

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14948

    Bas

    hi,

    On android an secure call through XMLHttpRequest is not working.

    on IOS this is working fine.

    why is this?

     

    #14956

    Günther
    V-Play Team

    Hi Bas!

    What device (os version) are working on and which SDK version are you using for building?

    It usually also works on Android to make XMLHttpRequest calls with an https url. As an example, you should get a valid response from https://maps.googleapis.com/maps/api/geocode/json?address=vienna:

        var xmlHttpReq = new XMLHttpRequest()
        xmlHttpReq.onreadystatechange = function() {
          if(xmlHttpReq.readyState == xmlHttpReq.DONE && xmlHttpReq.status == 200) {
            console.log("SUCCESS: "+JSON.stringify(xmlHttpReq.responseText))
          }
          else if(xmlHttpReq.readyState == xmlHttpReq.DONE && xmlHttpReq.status != 200) {
            console.error("Error: Failed to load data from "+url+", status = "+xmlHttpReq.status+", response = "+XMLHttpRequest.responseText)
          }
        }
    
        xmlHttpReq.open("GET", "https://maps.googleapis.com/maps/api/geocode/json?address=vienna", true)
        xmlHttpReq.send()

    Does this code work for you? If it does, your problem could also be related to the SSL server configuration.

    Best,
    Günther

     

    #14958

    Bas

    hi Günther,

    thanx for that, the example works fine!

    have to look at the SSL certificate then.

    thanx for the fast reply and excellent support :)

    #14959

    Bas

    i get the following error on an Android  tablet running android 6.0 :

    qt.network.ssl: could not set SSL_CTRL_SET_TLSEXT_HOSTNAME, Server Name Indication disabled

    and then 7 times this error:

    (null):0 ((null)): qt.network.ssl: QSslSocket: cannot call unresolved function CRYPTO_free

    when i look up the error the direction points me towards:

    https://bugreports.qt.io/browse/QTBUG-51084

     

Viewing 4 posts - 1 through 4 (of 4 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