Asp net err ssl protocol error

I am running a simple ASP.net web application. Chrome is showing the below error after running this. localhost sent an invalid response. Try running Windows Network Diagnostics. ERR_SSL_PROTOCOL_ER...

First, check your site web binding detail by the following detail:

  1. Open visual studio, select your project.

  2. right-click on the project and select properties.

  3. under the Web tab and check your project url.

enter image description here

make sure there no such setting in your web.conifg file like below:

<system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="Strict-Transport-Security" 

        value="max-age=16070400; includeSubDomains" />
      </customHeaders>
    </httpProtocol>
</system.webServer>

When the browser sees this, it will remember, for the given number of seconds, that the current domain should only be contacted over HTTPS. In the future, if the user types http:// or omits the scheme, HTTPS is the default.

Clear your browser cache.

Another thing you could try to find the cause is open chrome and type chrome://net-internals/#hsts in the address bar and search for localhost:

enter image description here

The query shows “localhost” as being in the list of domains in the HSTS set.

The solution is deleting the domain from the cache. type “localhost” into the Delete domain text field, and hit Delete. After doing that when you query for “localhost” again you will receive a “Not found”.

enter image description here

Problem encountered on https://dotnet.microsoft.com/learn/aspnet/hello-world-tutorial/run
Operating System: windows

Provide details about the problem you’re experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

When running the project (dotnet run) I cannot access the site on localhost:5000. Chrome complains that the site cannot provide a secure connection. The details in the console are as follows:

Using launch settings from C:UsersnorudermDocumentstestdotnetmyWebAppPropertieslaunchSettings.json… info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] User profile is available. Using ‘C:UsersnorudermAppDataLocalASP.NETDataProtection-Keys’ as key repository and Windows DPAPI to encrypt keys at rest. Hosting environment: Development Content root path: C:UsersnorudermDocumentstestdotnetmyWebApp Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down. info: Microsoft.AspNetCore.Server.Kestrel[17] Connection id «0HLUJ8UCBDCDL» bad request data: «Invalid request line: ‘x16x03x01x02x00x01x00x01xFCx03x03xBExCBvKxD38xC3x0Dx84pxE9x0Dx9F#x82x1Bjx83xF4xAE[x03x89x96xBB’kx05xB5xBDx88xAF 5xD4xE7x97x11x1FxDFvqo!xFDxB5xDCkxBALxE6]x0BZxFBx00Kx86xD0xCFQxA0xF4x00"x9Ax9Ax13x01x13x02x13x03xC0+xC0/xC0,xC00xCCxA9xCCxA8xC0x13xC0x14x00x9Cx00x9Dx00/x005x00x0A'" Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid request line: 'x16x03x01x02x00x01x00x01xFCx03x03xBExCBvKxD38xC3x0Dx84pxE9x0Dx9F#x82x1Bjx83xF4xAE[x03x89x96xBB'kx05xB5xBDx88xAF 5xD4xE7x97x11x1FxDFvqo!xFDxB5xDCkxBALxE6]x0BZxFBx00Kx86xD0xCFQxA0xF4x00″x9Ax9Ax13x01x13x02x13x03xC0+xC0/xC0,xC00xCCxA9xCCxA8xC0x13xC0x14x00x9Cx00x9Dx00/x005x00x0A’ at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.RejectRequestLine(Byte* requestLine, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.GetUnknownMethod(Byte* data, Int32 length, Int32& methodLength) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, Byte* data, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.IHttpParser.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TakeStartLine(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.ParseRequest(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TryParseRequest(ReadResult result, Boolean& endConnection) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication1 application) info: Microsoft.AspNetCore.Server.Kestrel[17] Connection id "0HLUJ8UCBDCDK" bad request data: "Invalid request line: 'x16x03x01x02x00x01x00x01xFCx03x03x85xCDxF0LxF8FxA5 x1BxFDxF3^xAEx9Ax06x1Ax9D/xC6xA3[xBBfxA4!xC0xAAxD58x0A'" Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid request line: 'x16x03x01x02x00x01x00x01xFCx03x03x85xCDxF0LxF8FxA5 x1BxFDxF3^xAEx9Ax06x1Ax9D/xC6xA3[xBBfxA4!xC0xAAxD58x0A' at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.RejectRequestLine(Byte* requestLine, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.GetUnknownMethod(Byte* data, Int32 length, Int32& methodLength) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, Byte* data, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.IHttpParser<TRequestHandler>.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TakeStartLine(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.ParseRequest(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TryParseRequest(ReadResult result, Boolean& endConnection) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication1 application) info: Microsoft.AspNetCore.Server.Kestrel[17] Connection id «0HLUJ8UCBDCDN» bad request data: «Invalid request line: ‘x16x03x01x02x00x01x00x01xFCx03x03x9C)ixC7x137xEFXx03xEExEFx1Ax93x98xEAxx9FxFAxDD9dx93N<5xB0dR%xDDwxE3 x10xF35,xA4x98″7X3xECnxC2xF5xC7xE0xB3g!xE6vBDxBExADxB4x82xF7xB3x9Fx0DxC1x00″x8Ax8Ax13x01x13x02x13x03xC0+xC0/xC0,xC00xCCxA9xCCxA8xC0x13xC0x14x00x9Cx00x9Dx00/x005x00x0A'» Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid request line: ‘x16x03x01x02x00x01x00x01xFCx03x03x9C)ixC7x137xEFXx03xEExEFx1Ax93x98xEAxx9FxFAxDD9dx93N<5xB0d
R%xDDwxE3 x10xF35,xA4x98″7X3xECnxC2xF5xC7xE0xB3g!xE6vBDxBExADxB4x82xF7xB3x9Fx0DxC1x00″x8Ax8Ax13x01x13x02x13x03xC0+xC0/xC0,xC00xCCxA9xCCxA8xC0x13xC0x14x00x9Cx00x9Dx00/x005x00x0A’ at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.RejectRequestLine(Byte* requestLine, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.GetUnknownMethod(Byte* data, Int32 length, Int32& methodLength) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, Byte* data, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.IHttpParser.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TakeStartLine(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.ParseRequest(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TryParseRequest(ReadResult result, Boolean& endConnection) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication1 application) info: Microsoft.AspNetCore.Server.Kestrel[17] Connection id "0HLUJ8UCBDCDM" bad request data: "Invalid request line: 'x16x03x01x02x00x01x00x01xFCx03x037xB2x9DBxEA9xFFx08xD5uLx02#x08x92=xC1XxA0x16ixFBhx81ex0CBx1D*ezp x95xCFxEE"xFB[=vx93xB1tx95xA3xF2)xADxD8xF9bxF9x96U%g?Qx19"|xD9yxCFx00"zzx13x01x13x02x13x03xC0+xC0/xC0,xC00xCCxA9xCCxA8xC0x13xC0x14x00x9Cx00x9Dx00/x005x00x0A'" Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid request line: 'x16x03x01x02x00x01x00x01xFCx03x037xB2x9DBxEA9xFFx08xD5uLx02#x08x92=xC1XxA0x16ixFBhx81ex0CBx1D*ezp x95xCFxEE"xFB[=vx93xB1tx95xA3xF2)xADxD8xF9bxF9x96U%g?Qx19"|xD9yxCFx00"zzx13x01x13x02x13x03xC0+xC0/xC0,xC00xCCxA9xCCxA8xC0x13xC0x14x00x9Cx00x9Dx00/x005x00x0A' at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.RejectRequestLine(Byte* requestLine, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.GetUnknownMethod(Byte* data, Int32 length, Int32& methodLength) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, Byte* data, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.IHttpParser<TRequestHandler>.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TakeStartLine(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.ParseRequest(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TryParseRequest(ReadResult
result, Boolean& endConnection) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication1 application) info: Microsoft.AspNetCore.Server.Kestrel[17] Connection id «0HLUJ8UCBDCDO» bad request data: «Invalid request line: ‘x16x03x01x02x00x01x00x01xFCx03x032xEAxDAxA3xEEx01xCFx10CxB2xDE5Cx87xB8xC9qx9ExA8ZxB4xB8xF8xBBx8Ax10’xDExFExEEx1A xE5x8Fx91xECxCDQxB7xB0mxA5xC2xBAx9EBxEBxCFxBE,Dgx1DhLx0F%xFFxCDxF6!5[&x00″xDAxDAx13x01x13x02x13x03xC0+xC0/xC0,xC00xCCxA9xCCxA8xC0x13xC0x14x00x9Cx00x9Dx00/x005x00x0A'» Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid request line: ‘x16x03x01x02x00x01x00x01xFCx03x032xEAxDAxA3xEEx01xCFx10CxB2xDE5Cx87xB8xC9qx9ExA8ZxB4xB8xF8xBBx8Ax10’xDExFExEEx1A xE5x8Fx91xECxCDQxB7xB0mxA5xC2xBAx9EBxEBxCFxBE,Dgx1DhLx0F%xFFxCDxF6!5[&x00″xDAxDAx13x01x13x02x13x03xC0+xC0/xC0,xC00xCCxA9xCCxA8xC0x13xC0x14x00x9Cx00x9Dx00/x005x00x0A’ at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.RejectRequestLine(Byte* requestLine, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.GetUnknownMethod(Byte* data, Int32 length, Int32& methodLength) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, Byte* data, Int32 length) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpParser1.Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.IHttpParser.ParseRequestLine(TRequestHandler handler, ReadOnlySequence1& buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TakeStartLine(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.ParseRequest(ReadOnlySequence1 buffer, SequencePosition& consumed, SequencePosition& examined) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TryParseRequest(ReadResult result, Boolean& endConnection) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication`1 application)

RRS feed

  • Remove From My Forums
  • Question

  • User992700523 posted

    This site can’t provide a secure connection

    localhost sent an invalid response.

    • Try running Windows Network Diagnostics.

    ERR_SSL_PROTOCOL_ERROR

    This error shows when i run my page. Even i delete and add web.config file multiple times and also add it in the trusted website but it didn’t show any progress. The page still shows. Kindly help.

    Regards,
    Muhammad Naveed Haroon

All replies

  • User61956409 posted

    Hi Muhammad Naveed Haroon,

    You can try to browse the site using other browser(s) and check if same error appears.

    Besides,
    this blog explained how to fix ‘ERR_SSL_PROTOCOL_ERROR’ on Google Chrome, you can try the possible solution, such as clearing Browsing Data, enabling all SSL/TLS versions etc.

    With Regards,

    Fei Han

  • User1281381861 posted

    Are you running local host site with https protocol?

    Have you set correct SSL certificate on your website?

    Please check the expiry date of your SSL certificate.

Alt Text

From what we’ve seen in the «regular» failed HTTP requests a status code of zero usually means two things:

  • The server is down
  • Authorization didn’t happen.

In this case we saw the negotiation request sent, with an immediate failure. Our server was up and running and we had set up CORs. We were stumped.

Indeed the seemingly ubiquitous nefarious ugly and mystery error showed:

🍋🍋🍋🍋🍋


Failed to load resource: net:: ERR:SSL_PROTOCOL_ERROR

We see the Websocket failure in this trace:

Alt Text

Its content showed this:

Alt Text

Not much information here. Let’s look at backend. The output window showed this interesting clue.

2020-06-10T09:50:48.3243364-05:00 | [Warning]
Message: Authorization failed for  at RouteEndpoint

Enter fullscreen mode

Exit fullscreen mode

This Error is instantly painful when it happens because the journey to solve it is difficult.

  • This error does not deal with non secure requests. If you are running an http site, not https, websockets is still able to connect, so we know that SignalR works on both schemas. However, if you are running just http then be aware that you need to add redirect middleware.

We never figured the root cause of this error, but we did find a solution. We made sure our site was using HTTPs, this fixed the problem.

Понравилась статья? Поделить с друзьями:
  • Asp net core return internal server error
  • Asp net core cors error
  • Asp net core 500 internal server error
  • Asp net core 403 error
  • Asp net application error