How to disable HTTPS in Visual Studio 2017 Web Proj ASP.NET Core 2.0

I created a default project in Visual Studio 2017 with ASP.NET Core 2.0. I chose a web application with MVC and with individual use of Auth. By default, it is configured and works with https. I tried disabling this by going into the project properties and deleting the user ssl and changing https to http, but then I will get an IIS Express Connection or 404 error.

I have not seen https by default before. Where does this come from and where can I turn it off?

+19
source share
5 answers

I just created a default MVC application using net core 2.0.

To disable SSL, you need to do 2 steps. You can do this either using the Visual Studio GUI or by editing the launchsettings.json file (hereinafter)

  • go to the properties of your project
  • Uncheck SSL
  • Copy the application URL to the Start browser input enter image description here

And voila:

enter image description here

If you are not a fan of using the interface, you can alternatively edit the launchsettings.json file by setting sslPort: 0 and "launchUrl": "http://localhost:13121/" (or wherever you want to run the application)

 { "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:13121/", "sslPort": 0 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "launchUrl": "http://localhost:13121/", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, "WebApplication1": { "commandName": "Project", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, "applicationUrl": "http://localhost:13122/" } } } 
+26
source

Go to App Properties and uncheck "Enable SSL"

Go to Application Properties and uncheck "Enable SSL"

+5
source

I had the same problem (i.e. I need a non-SSL URL to create a working ngrok.com tunnel)

There is probably an alternate unsecured localhost URL.

I understand that the issue is disabling the protected, but you probably don't need this. You may already have unprotected.

Admittedly, I inherited this project, so I don't know if the same project will be the default. My guess is that an unprotected URL is available to you, which you can ignore.

Just look at the properties of the "Development Server".

See my screenshot below:

enter image description here

0
source

If the answer provided by @Marco did not solve the problem, you can try this,

When creating a new .net core mvc application in _Layout cshtml, the default meta tag will be generated to update the http request to https ("http-equivalent =" Content-Security-Policy "content =" upgrade-insecure-requests "). When deploying the application on a server without http, you may need to remove the tags below

http-equ = "Content-Security-Policy" content = "upgrade-insecure requests"

Also comment the line below from the file Startup.cs

app.UseHttpsRedirection ();

0
source

I use the SHIBIN solution (comment app.UseHttpsRedirection () in the Startup.cs file) and the Marco solution (edit launchsettings.json file) at the same time ... After publishing my test project that responds without https (MS VS Community 19, rel.16.1. 3) Perhaps this is not good (it is unsafe), but it works ...

0
source

Source: https://habr.com/ru/post/1012322/


All Articles