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 for the feedback!

    royalbee said:
    Is that also a limitation with the http_client library?  (currently our server doesn't support that response header)

     I’m honestly not sure about this one, I have to check that internally.

    Would you provide me with an application log and a modem trace?

    Thanks and regards,

    Markus

  • Hi,

    In order to make sure that it is not some kind of bug caused by our application, I now used your https_client sample application (slightly modified for our test).
    This (sample) application doesn't even use the http_client library, it works directly with sockets send() and recv() calls (which http_client uses underneath).

    And the same problem happened there as well. So it does seem like a real problem with the modem/secured-sockets SDK implementation.


    I added the application logs and the modem traces, of both cases: one with none-secured-sockets (=http) that worked fine, and one with secured sockets (https ssl) that got 0 bytes from the server (which closes the socket by remote):

Reply
  • Hi,

    In order to make sure that it is not some kind of bug caused by our application, I now used your https_client sample application (slightly modified for our test).
    This (sample) application doesn't even use the http_client library, it works directly with sockets send() and recv() calls (which http_client uses underneath).

    And the same problem happened there as well. So it does seem like a real problem with the modem/secured-sockets SDK implementation.


    I added the application logs and the modem traces, of both cases: one with none-secured-sockets (=http) that worked fine, and one with secured sockets (https ssl) that got 0 bytes from the server (which closes the socket by remote):

Children
No Data
Related