6 Replies Latest reply on Nov 7, 2017 7:53 PM by axel.lin_1746341

    Files of more than 200KB get corrupted when downloaded via https in WICED 5.2

    webmstreric

      I couldn't download a file larger than about 200KB using a secure WICED 5.2 connection, so I went back to your snip.https_client and created a simple program that replicated the problem on your BCM943907AEVAL1F board. The program downloads a 909,740 byte file and compares it to a previously saved file that is identical. This program successfully downloads every byte when built using WICED 5.1, but when using WICED 5.2, after about 200KB where the downloaded bytes exactly match the previously saved bytes, the downloaded bytes become different from the previously saved bytes. Using a terminal that displays 100 characters in the horizontal this is the console output:

       

      WICED 5.1:

       

      Starting WICED v5.1.0

      Platform CYW943907AEVAL1F initialised

      Started ThreadX v5.6

      Initialising NetX_Duo v5.7_sp2

      Creating Packet pools

      WLAN MAC Address ****

      WLAN Firmware    : wl0: Jul 12 2017 14:22:51 version 7.15.168.90 (r665791) FWID 01-772425

      WLAN CLM         : API: 12.1 Data: 7.17.2 Compiler: 1.26.3 ClmImport: 1.26.12 Creation: 2015-01-10 11:06:18 Inc Data: 9.10.48 Inc Compiler: 1.31.3 Inc ClmImport: 1.36.3 Creation: 2017-07-12 14:21:10

      Joining : ****

      Successfully joined : ****

      Obtaining IPv4 address via DHCP

      DHCP CLIENT hostname WICED IP

      IPv4 network ready IP: ****

      Setting IPv6 link-local address

      IPv6 network ready IP: ****

      Resolving IP address of HTTPS server

      Server is at ****

      Getting '/'...

      Read the certificate Key from DCT

      About to Connect.

      waiting for HTTP reply

      One tick mark "|" is displayed for every packet downloaded.

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||

      Server returned

       

      WICED 5.2

       

      Starting WICED vWiced_005.002.000.0022

      Platform BCM943907AEVAL1F initialised

      Started ThreadX v5.6

      Initialising NetX_Duo v5.7_sp2

      Creating Packet pools

      WLAN MAC Address : ****

      WLAN Firmware    : wl0: Jul 21 2017 03:05:13 version 7.15.168.92 (r666012) FWID 01-772425

      WLAN CLM         : API: 12.2 Data: 9.10.49 Compiler: 1.31.3 ClmImport: 1.36.3 Creation: 2017-07-21 03:01:15

      Joining : ***

      Successfully joined : ****

      Obtaining IPv4 address via DHCP

      DHCP CLIENT hostname WICED IP

      IPv4 network ready IP: ****

      Setting IPv6 link-local address

      IPv6 network ready IP: *****

      Resolving IP address of HTTPS server

      Server is at *****

      Getting '/'...

      Read the certificate Key from DCT

      About to Connect.

      waiting for HTTP reply

      One tick mark "|" is displayed for every packet downloaded.

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

      ||||||||||||||||||

      Corrupted data found starting at byte number 196240. Displayed as Valid byte = Downloaded byte

      E0=24 28=2A 40=9D 07=0F 08=4C 28=D2 3A=69 07=34 08=13 28=C1 3C=14 07=58 08=23 28=3E 3F=E0 07=28

      08=40 28=07 3D=08 07=28 08=3A 28=07 3B=08 07=28 08=3C 28=07 3E=08 07=28 08=3F 68=07 41=08 07=28

      08=3D 4F=07 EA=08 73=28 00=3B 80=07 EA=08 02=28 01=3E 01=07 F0=08 AA=68 31=41 4A=07 40=08 48=4F

      ...

      Get failed: 4

       

      i have attached the code where I removed our URLs, filenames and security keys and replaced them with ***, so you will need to fix that before the code will run.

      Build using "make https_client-BCM943907AEVAL1F download download_apps run"

       

      NOTE: I copied wiced_https_get() from libraries/protocols/HTTP/http.c and then modified it so that it would download a 909,740 byte file and compare that to an identical copy that was saved in APP1 using download_apps when the project was built. I also used an older version of https_client, because the version that came with WICED 5.2 could not connect at all. Although, in hindsight it looks to me like the problem with WICED 5.2's https_client is probably nothing more that a bad hard coded certificate.