Reputation: 36820
I've installed Visual Studio 2019 and uninstalled Visual Studio 2017.
Now if I start an ASP.NET (Core) site with https, it always say on Chrome:
This site can’t provide a secure connection
or on Edge
Can’t connect securely to this page
Chrome:
Edge:
The URLs are correct. This also the same http://localhost:56784/ (it redirects to https)
What I've tried:
I think the issue is introduced by:
The underlining issue looks like a wrong/old/not supported TLS version?
What can I do to diagnose/fix the problem?
Upvotes: 25
Views: 47538
Reputation: 114
None of this worked for me. What did work (and it's not as drastic as the other answers)...
Go into web project and set Start URL and Project URL to this: https://localhost:44365/
Save (but don't run the Project).
Edit .vs/[ProjectName]/config/applicationhost.config and change the bindings for the web project to this:
<binding protocol="https" bindingInformation="*:44365:localhost" />
<binding protocol="http" bindingInformation="*:53269:localhost" />
Reopen Visual Studio and when I started the website it worked.
Upvotes: 2
Reputation: 138
If you 'are using services.AddHttpsRedirection like
services.AddHttpsRedirection(options =>
{
options.RedirectStatusCode = (int)HttpStatusCode.TemporaryRedirect;
options.HttpsPort = Configuration.GetValue<int?>("https_port", null);
});
Make sure HttpsPort is null or a valid port in appsettings.json or appsettings.Development.json file.
Upvotes: 0
Reputation: 387
In my case use SSL check box was gone in debug section of project properties. everything was fixed by checking again
Upvotes: 2
Reputation: 7069
Just follow below steps:
.vs
folderAs per my understanding, .vs
folder keeps the old settings inside the applicationhost.config
file. So better to delete all cached settings and start with fresh.
Upvotes: 4
Reputation: 2029
Right click on the project, select Properties, 'Debug', check the checkbox "Enable SSL", that's it, worked with me by doing this
Upvotes: 0
Reputation: 674
For those who all the above methods didn't worked:
open a command prompt and then run:
dotnet dev-certs https --clean
and then:
dotnet dev-certs https --trust
Upvotes: 11
Reputation: 378
None of the above solutions worked for me, Following steps worked for me.
Go to chrome or edge browser and type chrome://net-internals/#hsts
search for localhost in query domain, you will find lists of domain including localhost. Now delete the domain
Delete the domain by typing localhost
Upvotes: 6
Reputation: 563
Just as it did not work for @Nosnetrom
- repairing IIS 10.0 Express did not work for me either. As @Julian
mentioned my problem was caused by uninstalling VS 2017 as well.
This is what did not work for me:
This is what worked for me:
C:\Program Files (x86)\IIS Express\config\templates\PersonalWebServer\applicationhost.config
. I had to open that file in Notepad ran as an administrator otherwise I could not save these changes:
Upvotes: 38