c# - .net 核心 2.1.3 ssl 错误

标签 c# ssl .net-core

大家好,我现在使用的是 .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/

相关文章:

ssl - 嵌入式 Tomcat - 无需重启即可更新/删除证书

c# - Assembly.Load 用于不在 deps.json 文件中的程序集

c# - .NET Core/EF Core 2.0 升级后急切加载 "No coercion operator is defined between types"

c# - asp.net mvc 核心依赖注入(inject)构造函数参数

c# - 找到圆边上的坐标

C#如何使用Uri equal?

c# - .net 核心中的库配置?

c# - 验证 - (表单)取消按钮不起作用

optimization - 在 SSL 中的无 cookie 域上提供静态内容是否明智?

linux - 非https网站显示https网站内容