Share via

Azure Sphere OS Curl TLS/HTTPS GET Request Timesout When URL Length Exceeds ~1500 Bytes

James Higgins 336 Reputation points
2021-02-11T18:05:19.127+00:00

When a simple curl HTTPS request is made with a URL exceeding ~1500 bytes the curl connection will timeout per the application defined handle configuration.
A TLS Encrypted Alert is sent from the Sphere OS to the remote server.

After this point the curl handle no longer works on subsequent requests and will return SSL: SSL_set_session failed: unknown error number. After some testing the curl handle is in the same broken state as this other bug I submitted even though the triggering event cause is different:

Azure Sphere OS Persistent Curl Handle using TLS Enters Failure Mode That Keeps Resetting Its Own TCP Connection
https://learn.microsoft.com/en-us/answers/questions/249213/azure-sphere-os-persistent-curl-handle-using-tls-e.html

If the size of the URL request is kept below the failure threshold then the curl handle does not fail.
A non-TLS curl HTTP request URL can be much larger >6000 bytes without failing.

I have traces, logs, and a simple example program that demonstrates the problem within a minute.

Azure Sphere
Azure Sphere

An Azure internet of things security solution including hardware, operating system, and cloud components.


Answer accepted by question author

António Sérgio Azevedo 7,671 Reputation points Microsoft Employee Moderator
2021-03-11T18:53:16.617+00:00

@James Higgins as we have discussed offline, you confirmed: "I just tried to reproduce it using my test program and the ~1500 byte limitation does not seem to apply anymore."

I am posting this as the answer to inform community that it does not happens anymore after updating to the latest 21.02 release.

Update 16 March 2021

We believe that the patch that we did for cURL CVE-2020-8285 is responsible for the solution. The documentation on this CVE can be found here: https://curl.se/docs/CVE-2020-8285.html. While the CVE describes exploiting the previous design for this component, it is likely that the limited memory environment for Azure Sphere was also triggering this design to behave as reported. The fix to the CVE removes unnecessary recursion and its associated stack usage, providing less opportunity to accidently run out of stack space.

Thanks!

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.