This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem with nRF-connect-SDK http_client_req() function

Hi,


I open ssl socket to the server (without certificate verification),
and then use an http_client_req() call, to perform the actual http request (with additional optional headers).

That works fine for both http GET and POST requests, that have a short response from the server.

However, when the server's response is a bit larger (say 2.5KB not including response headers and cookie), I always get "Socket was closed by remote" error (-104).
I tried increasing recv_buf_len from 1KB to 8KB, but it didn't help.

When debugging http_client_req(), I see that the call to socket's recv() just returns 0 bytes, which is considered socket close by remote.
On the server logs I see that HTTP request, but no special problems appear on aws elb logs.

Performing the same request on my PC (using Postman for example), works just fine, so the problem is not on the server side (at least not with standard http/tcp settings)/

thanks in advance..


Parents
  • Thanks a lot for your feedback!

    royalbee said:
    Maybe you can try to check this problem on your side as well? just connect to any server that supports ssl and returns response that is longer than 2.5K (I actually think that 2K will also be enough).

    Our modem does not supported TLS fragments larger than 2kB. You have to send smaller responses in this case, or download the data bit for bit. Could you try this and check if that makes any differences?

    Regards,

    Markus

  • Hello Markus.

    I'm Ran's manager. Please allow me to add my inquiry.

    I'm quite concerned, and would like to know if the nRF9160 can fit our needs.

    As I understand, the modem doesn't support receiving data larger than 2KB over SSL sockets.

    Is that so?

    We will not be able to get our system to work with this unexpected limitation.

    Is there a proven patch we can add to the modem FW to work around this limit?

    Is there a date on your road map to remove this limitation altogether?

    Thank you

       Koby Fruchtnis

       R&D Manager, Atomation

    By the way, the limitation of 2KB secure socket buffer size was introduced starting from 1.1.0.
    It did not exist prior to that version.

    *** mfw_nrf9160_1.1.0
    *********************
    ...
    
    *** Limitations
    ***************
    - TLS/DTLS
        ...
        - 2kB secure socket buffer size.

Reply
  • Hello Markus.

    I'm Ran's manager. Please allow me to add my inquiry.

    I'm quite concerned, and would like to know if the nRF9160 can fit our needs.

    As I understand, the modem doesn't support receiving data larger than 2KB over SSL sockets.

    Is that so?

    We will not be able to get our system to work with this unexpected limitation.

    Is there a proven patch we can add to the modem FW to work around this limit?

    Is there a date on your road map to remove this limitation altogether?

    Thank you

       Koby Fruchtnis

       R&D Manager, Atomation

    By the way, the limitation of 2KB secure socket buffer size was introduced starting from 1.1.0.
    It did not exist prior to that version.

    *** mfw_nrf9160_1.1.0
    *********************
    ...
    
    *** Limitations
    ***************
    - TLS/DTLS
        ...
        - 2kB secure socket buffer size.

Children
No Data
Related