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
  • Hello Koby,

    kobyatom said:
    Does that mean that HTTPS GET and POST not be supported if I use TLS Sockets?

    The Serial LTE modem application does not come with native TLS support for FTP and HTTP. But it is possible to add it to this or any other application.

    As a reference, you can have a look at this example. The commit adds native TLS support to TCP proxy command within the Serial LTE modem application. Hence, similar changes could be made for HTTP commands to add native TLS support or the host could run the HTTP stack and the client can manually send HTTP via the TCP commands.

    kobyatom said:
    Regarding "content-range", will it also work when sending data > 2KB?

     Yes, this should be possible as well.

    kobyatom said:
    Regarding "We are continuously working on improving our products.", and since it will require a HW change to support TLS fragments > 2KB, is there a known plan to update the nRF9160 HW in that respect?

    I’m afraid I can’t give you any more information than I already gave you. You should discuss this with our local sales department. If desired, I can provide you with more details.

    Regards,

    Markus

Reply
  • Hello Koby,

    kobyatom said:
    Does that mean that HTTPS GET and POST not be supported if I use TLS Sockets?

    The Serial LTE modem application does not come with native TLS support for FTP and HTTP. But it is possible to add it to this or any other application.

    As a reference, you can have a look at this example. The commit adds native TLS support to TCP proxy command within the Serial LTE modem application. Hence, similar changes could be made for HTTP commands to add native TLS support or the host could run the HTTP stack and the client can manually send HTTP via the TCP commands.

    kobyatom said:
    Regarding "content-range", will it also work when sending data > 2KB?

     Yes, this should be possible as well.

    kobyatom said:
    Regarding "We are continuously working on improving our products.", and since it will require a HW change to support TLS fragments > 2KB, is there a known plan to update the nRF9160 HW in that respect?

    I’m afraid I can’t give you any more information than I already gave you. You should discuss this with our local sales department. If desired, I can provide you with more details.

    Regards,

    Markus

Children
No Data
Related