.net core 2.1.3 ssl error

六月ゝ 毕业季﹏ 提交于 2020-12-08 05:31:35

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/51311583/net-core-2-1-3-ssl-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!