Reputation: 209
Hello guys right now I am using .net core 2.1.3 when I install webapi project by "dotnet new webapi" when I try to open by firefox or chrome it gives me this error
HttpsConnectionAdapter[1] Failed to authenticate HTTPS connection. System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
Upvotes: 20
Views: 9407
Reputation: 391
I face the same problem. In my test, it seems the problem using Kestrel with SSL. (other IISExpress is OK)
It look like the SSL is not ready yet, when you browse it.
The workaround for me is just simply change the position in launchSetting:
"applicationUrl": "https://localhost:443;http://localhost:80"
to
"applicationUrl": "http://localhost:80;https://localhost:443"
With app.UseHttpsRedirection();
in Startup.cs
it will go to port 80 first and then redirect to port 443
Upvotes: 22
Reputation: 159
can you try running the command dotnet dev-certs https --trust
If your development certificate is not trusted, it should prompt you to accept it. My issue got resolved after running it. and next time you run the command again,it will tell you that the certificate is valid.
Upvotes: 0