6 Replies Latest reply on Jun 23, 2014 3:16 AM by Andreas Marchart

    Problem uploading big files with HTTPS

    Andreas Marchart



      we developed a RhoMobile applicaton, where it is possible to capture a signature and send this signature to a server.

      For the uplaod, we use the network upload file function:

      r = Rho.Network.uploadFile(obj);


      When we use a HTTP connecton the file upload is working fine. We tested to send an image with about 1 MB and this is transferred  within few seconds.


      When we use a HTTPS connection, the upload is working fine for small files (e.g. a 2,5 KB png file is working). If there is a bigger file, for example with 100 KB, on some devices the server returns immediatley status 400 and no result message and on other devices we are running into a timeout. But if we change the connection type to HTTP it is working fine.


      Is there a difference between a HTTP and a HTTPS connection for the file upload?

      Is there maybe a special parameter for the timeout or something else which should be configured in addition?


      Thank you in advance.


      Best Regards,


        • Re: Problem uploading big files with HTTPS
          Kutir Mobility

          To my knowledge, there is no difference.

          Have you tried increasing the timeout value as described here http://docs.rhomobile.com/en/4.0.0/api/Network#presponseTimeout


          If that is also not working, then do you see any error messages and app side and server side?



          Visnupriya R

          Kutir Mobility

            • Re: Problem uploading big files with HTTPS
              Andreas Marchart



              thank you for your answer.


              Yes, I tried already to increase the timeout with the responseTimeout.


              The strange thing is, that even if there is a error on the client, the server is processing the image correct.

              I tried it now with different timeout settings and sometimes it is working fine, I got the result from the server within few seconds. But sometimes, it seems that server and client are waiting, and nothing is happening.

              If I set the timeout to 10 seconds, than 10 seconds nothing happens, then the client cancels the connection and the server is processing the image and tries to send back status 200. If I set the timeout to 30 seconds, then 30 seconds nothing happens and then the client cancels the connection and then the server process the image correct. But this happens only with a HTTPS connection.

              On the server there is no error, because after the client cancels the connection, the server is processing the image correct. I tried to capture the network traffic with Wireshark and there it seems, that the handshake is correct, the first data packages are send correct, then there is the timeout (of e.g. 30 seconds) and then the last data package is received.


              On the client I got the following log (e.g. for a 30 second timeout):

              I/APP ( 3764): I 05/27/2014 10:17:44:510 0000eb3 NET | POST request (Push): https://...

              I/APP ( 3764): E 05/27:2014 10:18:14:611 0000eb3 SSLImplJava | Call of "recv" failed: SocketTimeoutException: Read timed out

              I/APP (3764): E 05/27:2014 10:18:14:613 0000eb4 Net | Operation finished with error 28: Timeout was reached

              I/APP ( 3764): E 05/27/2014 10:18:14:613 0000eb4 Net | CURLNetRequest: METHODE = [POST] URL = [https://...] BODY = []

              I/APP ( 3764): E 05/27:2014 10:18:14:615 0000eb4 RhodesService | PING network FAILED


              For me it seems, that there is somewhere a timing problem or something gets lost in the traffic. Maybe it is a problem with our network configuration or HTTPS configuration on the IIS server. I will try to search, if I find something related to this....




              Best Regards,

              Andreas Marchart