Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android XMLHttpRequest doesn't work
Forum Updated to NodeBB v4.3 + New Features

Android XMLHttpRequest doesn't work

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 322 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.
  • F Offline
    F Offline
    Fogord
    wrote on last edited by
    #1

    Hello
    I add openssl libs to my project and sslsocket work fine. Included precompile libs KDAB

    SSLSOCKET connected to host: fztest
    SSLSOCKET Authentication:		RSA
    SSLSOCKET Encryption:		AESGCM(256)
    SSLSOCKET Key Exchange:		ECDH
    SSLSOCKET Cipher Name:		ECDHE-RSA-AES256-GCM-SHA384
    SSLSOCKET Protocol:		TLSv1.2
    SSLSOCKET encrypted
    SSLSOCKET handshake
    SSLSOCKET SSL support: true
    SSLSOCKET SSL version used for build: OpenSSL 1.1.1d  10 Sep 2019
    SSLSOCKET SSL version used for run-time: 269488207
    SSLSOCKET write:
    POST /Test.v2/REST/GetServerTime HTTP/1.1
    Connection: Keep-Alive
    Content-Type: application/json
    Host: fztest
    Content-length: 2
    SSLSOCKET bytes written: 151
    SSLSOCKET onReadyRead
    SSLSOCKET read finished
    SSLSOCKET post ended
    SSLSOCKET readAll:
    {"value":"29.03.2020 12:48:04","errorCode":0,"errorString":null}
    

    But when I send request from js by XMLHttpRequest I got the status of request 0
    With http it's work good.

    "NETWORK_HANDLER POST https://ecom.lan/list started..."
    "NETWORK_HANDLER sent"
    "NETWORK_HANDLER status: 0"
    "NETWORK_HANDLER response received:"
    

    QT 5.12.7
    Platform Android

    What i have missed?
    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you deploying the OpenSSL libraries with your application ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Fogord
        wrote on last edited by
        #3

        Thank you for replaying.

        What do you mean?
        The libs are added to project.

        Screenshot 2020-03-29 at 16.43.24.png

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Does it work properly if you execute your application in your development machine ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Fogord
            wrote on last edited by Fogord
            #5

            I found where was problem.
            Add code below before sslsocket init and its work fine with XMLHttpRequest for https.

            QSslConfiguration config = QSslConfiguration::defaultConfiguration();
                config.setPeerVerifyMode(QSslSocket::QueryPeer);
                QSslConfiguration::setDefaultConfiguration(config);
            

            Good luck

            1 Reply Last reply
            2

            • Login

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