5 Replies Latest reply on Oct 17, 2018 12:25 AM by test963local_3774766

    https get can not work correctly

    test963local_3774766

      I am testing snip.httpbin_org on CWY943907AEVAL1F. I use WICED-Studio-6.2.

       

      The original sample work correctly. I modified the  original source code to send data to my local server. I removed the CA check.

      I can send small file (size = 300kbyte). but  I could not send a file that is over 400kbyte size.

       

      Is it needed to change mbedtls/config.h ?

        • 1. Re: https get can not work correctly
          riya

          Hello,

          Root CA is to ensure the authenticity of the server. If you do not want a secure conneection, you can omit the certificates. In general, when a client wants to connect to a server, it sends a connection request. The server then sends a certificate in the server hello message. The client can verify the authenticity of the server as a trusted root ca is present with the client.

          As you were already able to establish a connection with your local server, I believe you are familiar with the flow. Can you give more details about the failure of sending the 400kB file? At what point it fails? Is your connection still intact with the server? Do you specifically have problems with "POST" request or with "GET" request only?

          2 of 2 people found this helpful
          • 2. Re: https get can not work correctly
            test963local_3774766

            Thank you for your replay.

            I use "400k.bin" that is filled with "0x35".  The size is just 400KB. I use "GET" request.

            I am checking the payload_data_length.  The server finished sending the data. But Device received only 16384byte data.

             

            When I checked by debug mode. "wiced_assert"  was called in tls_host_create_buffer function.

            I have checked "PUT" request . It's OK. But I have not checked "POST" request.

            • 3. Re: https get can not work correctly
              test963local_3774766

              I made simple files.  I have checked on AWS S3.

               

              HTTPS Get

              File Name "5M.bin"  the file size is just 5MByte ,  filled with 0xFF.

              ->  NG 

               

              File Name "5M1.bin"  the file size is 5MByte +1 Byte , filled with 0xFF

              -> OK

               

              I don't call  "wiced_tls_init_root_ca_certificates" function in "application_start" function.

              • 4. Re: https get can not work correctly
                nunokawa.akira_2072836

                It seems that the remaining data size is not managed properly.

                Since the variable is uint16, it seems that it is doing abnormal operation by judging with only the lower 16 bits of the actual file size.

                (For example,

                5MB is 0x00500000, it seems that it is recognized as 0 byte on the program.

                400KB is 0x00064000, so it seems that it is recognized as 16384 bytes on the program. )

                 

                Attach the modified file for reference.

                43xxx_Wi-Fi\libraries\protocols\HTTP_client\http_client.c

                 

                This seems like a cause, but what about it?

                1 of 1 people found this helpful
                • 5. Re: https get can not work correctly
                  test963local_3774766

                  I have tried the patch(http_client.c.zip).  and It worked correctly.

                  But I checked between local server.  It does not work correctly.  

                   

                  I run "testing snip.httpbin_org-debug download"  by WICED debug.

                  the system stopped by "wiced_assert"  at tls_host_create_buffer fucntion of wiced_tls.c.

                  And MBEDTLS_SSL_DEBUG_MSG( 1, ( "unknown record type" ) )  was called in ssl_tls.c.

                   

                  Is this another issue?