ERR_SSL_PROTOCOL_ERROR for localhost from Visual Studio debug ERR_SSL_PROTOCOL_ERROR for localhost from Visual Studio debug google-chrome google-chrome

ERR_SSL_PROTOCOL_ERROR for localhost from Visual Studio debug


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. type chrome://net-internals/#hsts in url and querying 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


Just create new Virtual Directory:

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

2-under the Web tab change your project url by changing the localhost to http://localhost:48333/ .

3- click Create Virtual Directory.

4- make sure you don't have this in web.config

<system.webServer>    <httpProtocol>      <customHeaders>        <add name="Strict-Transport-Security" value="max-age=16070400; includeSubDomains"/>      </customHeaders>    </httpProtocol></system.webServer>


If you are running .net core, just run Visual Studio as admin, or go to bin\Debug\netcoreapp3.1 directory, and issue. Wierdly, .net core. .net core surprisingly dont give any error.

%USERPROFILE%\\.dotnet\\tools\\dotnet-lambda-test-tool-3.1.exe --port 5059

change port number to whatever.