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

Does modem TLS support fragmentation to allow HTTPS requests greater than 2K secure socket buffer limit?

When I asked earlier, it was not possible to send HTTPS payloads greater than 2K due to the TLS secure socket buffer size limit.  I see in the most recent modem firmware release the size limit is still the same. 

It seems that this wouldn't be a problem if TLS fragmentation was supported and the modem negotiated a reduced TLS fragment size. 

Has TLS fragmentation with a negotiated size been investigated?  

Is it possible to send an HTTPS POST request with a payload greater than 2KB?

Is it possible to receive an HTTPS POST response with a payload greater than 2KB?

Is it possible to have TLS fragmentation working with the Native TLS approach?

Here are some related tickets that remain unresolved after many months:

https://devzone.nordicsemi.com/f/nordic-q-a/74251/nrf9160-serial-interface-with-https-support-for-large-post

https://devzone.nordicsemi.com/f/nordic-q-a/77351/problem-with-nrf-connect-sdk-http_client_req-function

Parents
  • Hello Anthony,

    Has TLS fragmentation with a negotiated size been investigated? 

    Is it possible to have TLS fragmentation working with the Native TLS approach?

    Unfortunately, it is not supported in any official branch of mbedTLS. 

    Is it possible to send an HTTPS POST request with a payload greater than 2KB?

    Is it possible to receive an HTTPS POST response with a payload greater than 2KB?

    No, it is not possible. And just for clarification: since the header is included in the 2kB limit, the payload will be even smaller.

    However, as I also mentioned in case 273122, you could try content-range as an alternative, if the server supports it. This http feature enables the possibility to split the payload into several <2kB packages.

    My apologies that I can’t give you any more pleasant news than this, but I hope my answer will still help you!

    Regards,

    Markus

Reply
  • Hello Anthony,

    Has TLS fragmentation with a negotiated size been investigated? 

    Is it possible to have TLS fragmentation working with the Native TLS approach?

    Unfortunately, it is not supported in any official branch of mbedTLS. 

    Is it possible to send an HTTPS POST request with a payload greater than 2KB?

    Is it possible to receive an HTTPS POST response with a payload greater than 2KB?

    No, it is not possible. And just for clarification: since the header is included in the 2kB limit, the payload will be even smaller.

    However, as I also mentioned in case 273122, you could try content-range as an alternative, if the server supports it. This http feature enables the possibility to split the payload into several <2kB packages.

    My apologies that I can’t give you any more pleasant news than this, but I hope my answer will still help you!

    Regards,

    Markus

Children
  • Hi Markus,

      I have another question regarding the content-range method.

    In our system we use HTTP POST to upload and download data.  We need both uploads that are greater than 2k and downloads that are greater than 2k. 

    For example for our DFU procedure, we send a POST where the body contains information about the device identity, hardware version and current firmware version and the server may respond with the data of a firmware image.  

    Another example for our log upload procedure, we send a POST with meta-data about the device which itself may be almost 1K due in inefficient ASCII/JSON encoding, and the device logs.  Each post will be validated and then deposited into a cloud-based storage system.  From my understanding, HTTP POST is not idempotent so each successive request may generate a result on the server.

    How does the Content-Range field work for a HTTP POST? Is the request only processed when the Content-Range is full received?     

    Does the server know when to abandon an incoming partial and incomplete POST request?

    Does it require sending the request multiple times, each time with a different Range in the header?  

    How would the http client sending the POST request know the size of the data that would be returned?

    How does the client know if the data previously received becomes invalid and the procedure needs to be restarted from the beginning?

    Would the SLM be able to handle a streamed http resposne by  having the server send Transfer Encoding: chunked   ?

Related