大家好,我现在使用的是 .net core 2.1.3 当我通过“dotnet new webapi”安装 webapi 项目时,当我尝试通过 firefox 或 chrome 打开时,它给了我这个错误
HttpsConnectionAdapter[1] Failed to authenticate HTTPS connection. System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
最佳答案
我遇到了同样的问题。 在我的测试中,似乎是将 Kestrel 与 SSL 结合使用的问题。 (其他IISExpress都可以)
当你浏览它时,它看起来像 SSL 还没有准备好。
我的解决方法是简单地更改 launchSetting 中的位置:
"applicationUrl": "https://localhost:443;http://localhost:80"
到
"applicationUrl": "http://localhost:80;https://localhost:443"
在 Startup.cs 中使用 app.UseHttpsRedirection();
会先到80端口,再重定向到443端口
关于c# - .net 核心 2.1.3 ssl 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51311583/