lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #65630] issue to download file bigger than 6KB using u


From: Stefano Oliveri
Subject: [lwip-devel] [bug #65630] issue to download file bigger than 6KB using using https protocol
Date: Tue, 23 Apr 2024 05:12:30 -0400 (EDT)

URL:
  <https://savannah.nongnu.org/bugs/?65630>

                 Summary: issue to download file bigger than 6KB using using
https protocol
                   Group: lwIP - A Lightweight TCP/IP stack
               Submitter: stf12
               Submitted: Tue 23 Apr 2024 09:12:30 AM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.2.0


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 23 Apr 2024 09:12:30 AM UTC By: Stefano Oliveri <stf12>
Hello,

I am working at a demo application running on STM32, and I am using:
- lwIP version STABLE-2.2.0
- Mbed TLS 2.28.7 branch released 2024-01-26

What I am trying to do is to download a couple of files from a server using
https protocol. My demo works fine if I use http, but I have some issue when I
switch to https. One is a small JSON file (few hundred bytes). The other file
is a fw binary of ~500KB.

I am using the httpc implementation in lwip/apps/http and I followed the
indication in the lwIP documentation to add the SSL/TLS with mbedTLS
(https://www.nongnu.org/lwip/2_1_x/group__altcp__api.html). For the
certificate I am using, for the moment, the test CA Certificates provided by
MBed TLS.

This is the issue.

I can download with success the small JSON file: 
  if (port == LWIP_IANA_PORT_HTTPS)
  {
    _this->connection_settings.altcp_allocator = &_this->tls_allocator;
  }
  else
  {
    _this->connection_settings.altcp_allocator = NULL;
  }

  /* start the http request for the JSON header */
  lwip_res = httpc_get_file_dns(p_host_name, port, p_request,
&_this->connection_settings, tcp_recv_cb, _this, &_this->p_connection_state);

But, when I try to download the binary file, the operation fails with a server
timeout (http_res == 5):
  if (port == LWIP_IANA_PORT_HTTPS)
  {
    _this->connection_settings.altcp_allocator = &_this->tls_allocator;
  }
  else
  {
    _this->connection_settings.altcp_allocator = NULL;
  }

  if (!SYS_IS_ERROR_CODE(res))
  {
    /* start the http request for the JSON header */
    lwip_res = httpc_get_file_dns(p_host_name, port, p_request,
&_this->connection_settings, tcp_recv_cb, _this, &_this->p_connection_state);


A strange thing, for me, is that if I replace in the server the binary file
with a small file (~6k) then the same code works fine.

I enabled some TCP log in lwIP to collect some information. Let me share this
info and my lwIP and Mbed TLS configuration.

Any suggestion about a possible root cause or how to debug this issue? Do you
think that it is an issue related to Mbed TLS, so I should not file this
request here? 

Best regards,
Stefano








    _______________________________________________________
File Attachments:


-------------------------------------------------------
Name: bug_fota_https.zip  Size: 33KiB
<https://file.savannah.nongnu.org/file/bug_fota_https.zip?file_id=55958>

    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://git.savannah.nongnu.org/cgit/administration/savane.git/snapshot/savane-758ecd5172e512b667882c3f5b73d7b5e9a30eb0.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?65630>

_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]