Monthly Archives: December 2024

Pay close attention to your network headers

Summary: BIG-IP from F5 does not seem to honor the “Expect: 100-Continue” header by default, and changes must be made on the F5 appliance.


Recently, an network application, which have worked since 2017, stopped working. The application is straigh forward enough. It checks if a service is working by doing (mainly) two things:

  1. Perform a “GET” using HTTP/1.1 to check for status 200
  2. Authenticate using Oauth 2.0 and receiving an access_token

After a change was made to the endpoint, switching to BIG-IP from F5, the second step failed. Running the program in Visual Studio produced the following error message:

The underlying connection was closed: An unexpected error occurred on a receive.

Searching for this error message will provide you with a lot of various suggestions, mostly related to the TLS protocol.

When I upgraded the project from .Net 4.8 to .Net 8.0, it started working. One difference I saw during the debugging was the headers sent by the application.

Header sent using .Net 4.8:

Content-Type: application/x-www-form-urlencoded
Host: example.com
Content-Length: 118
Expect: 100-continue
Connection: Keep-Alive

Header sent using .Net 8.0:

Content-Type: application/x-www-form-urlencoded
Content-Length: 118

A quick Google search on the phrase “Expect: 100-continue fails on F5” produced both an explanation and a fix. The short answer is that while the client is waiting for a “100 Continue” message, the F5 device is wating for more data.

References:

  • https://my.f5.com/manage/s/article/K94382824
  • https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100