ASP.NET Core 2.1 Invalid Request Line Issue

Yang picture Yang · Jul 23, 2018 · Viewed 11.4k times · Source

Our Linux Docker ASP.NET Core container server logs are getting filled by the following 'Informational' log entries since we've updated from .NET Core 2.0 to .NET Core 2.1 (SDK 2.1.302):

INFO|Microsoft.AspNetCore.Server.Kestrel|Connection id "0HLFG42JUAORG" bad request 
data: "Invalid request line: 
'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1B\x00\x00\x00M\x0A'" 
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid 
request line: 'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1B\x00\x00\x00M\x0A'

INFO|Microsoft.AspNetCore.Server.Kestrel|Connection id "0HLFG42JUAORH" bad request 
data: "Invalid request line: 
'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1B\x00\x00\x00M\x0A'" 
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid 
request line: 'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1B\x00\x00\x00M\x0A'

The connection ID is incrementing by 1 alpha/digit every second or so. The hex doesn't seem translate to anything meaningful (NUL NUL NUL SOH NUL NUL EOT NUL ESC NUL NUL LF).

Things we've ruled out:

  • It's not originating from WAN/LAN (disabled network access to the containers and the entries are still being generated).
  • It doesn't occur in our development environment (windows w/ Visual Studio)
  • Redeploying the docker container doesn't fix the issue.
  • We don't believe it to be an SSL issue since kestrel is configured for http only. We can access the app and it's websockets (SignalR) over https and wss

Answer

Gurgen Sargsyan picture Gurgen Sargsyan · Sep 21, 2019

It looks like you're hitting an HTTP endpoint over HTTPS.