.net 核心 2.1.3 ssl 错误 [英] .net core 2.1.3 ssl error

查看:24
本文介绍了.net 核心 2.1.3 ssl 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我现在使用 .net core 2.1.3当我尝试通过 firefox 或 chrome 打开时,通过dotnet new webapi"安装 webapi 项目时出现此错误

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] 无法验证 HTTPS 连接.System.IO.IOException:身份验证失败,因为远程方已关闭传输流.

HttpsConnectionAdapter[1] Failed to authenticate HTTPS connection. System.IO.IOException: Authentication failed because the remote party has closed the transport stream.

推荐答案

我面临同样的问题.在我的测试中,使用 Kestrel 和 SSL 似乎存在问题.(其他IISExpress也可以)

I face the same problem. In my test, it seems the problem using Kestrel with SSL. (other IISExpress is OK)

当您浏览 SSL 时,它似乎尚未准备就绪.

It look like the SSL is not ready yet, when you browse it.

我的解决方法只是简单地更改launchSetting中的位置:

The workaround for me is just simply change the position in launchSetting:

 "applicationUrl": "https://localhost:443;http://localhost:80"

 "applicationUrl": "http://localhost:80;https://localhost:443"

在 Startup.cs 中使用 app.UseHttpsRedirection();

With app.UseHttpsRedirection(); in Startup.cs

它会先去80端口,然后重定向到443端口

it will go to port 80 first and then redirect to port 443

这篇关于.net 核心 2.1.3 ssl 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆