Willy David Jr
Willy David Jr

Reputation: 9131

How to Disable SSL on ASP.NET Core API 3.1 Project in Visual Studio 2019 16.8.3 Build?

How will you disable SSL if you already set it up when you create your project to not use it on the first place? If I will try to create a new ASP.NET API 3.1 project without SSL, it will work fine when you first run it.

But on my case, I want to run it using

Project

setting under Debug -> Launch option:

enter image description here

Under this option, the typical option you usually see like check or uncheck SSL is missing so I am not able to disable it. So when you run this API template, you will prompt by the usual "Trust SSL Certificate" dialog box.

On the first place, I already disable SSL when I create my project, that's why it is strange to see this dialog box.

enter image description here

But when I changed the settings back to

IIS Express

under Debug -> Launch option, it was already been disabled, and when I run it, it runs fine without any issue about SSL notification. Is this an issue on Project option only?

enter image description here

Upvotes: 8

Views: 14563

Answers (3)

Aurelien B
Aurelien B

Reputation: 21

In Startup.cs try removing

//app.UseHttpsRedirection();

And in launchsettings.json:

"useSSL": false

Upvotes: 2

Matt Ghafouri
Matt Ghafouri

Reputation: 1577

To disable the dialog box, if your project launch set to 'project' and you don't want to see that dialog box, you just need to enter your application URL in the button input box with HTTP protocol.

the default app URL is Https://loclahost:5001 or Https://localhost:5000 that you can be changed to any other URL such as http://localhost:27510

Upvotes: 2

Wowo Ot
Wowo Ot

Reputation: 1529

In Startup.cs try removing

//app.UseHttpsRedirection();

Upvotes: 6

Related Questions