Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › XMLHttpRequest ssl get

Tagged: 

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

     

    #21963

    Berka Frenfert

    Thanks a lot Günther. I removed the ‘s’ and my code is fine now.

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

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded