简体   繁体   English

ASP.Net Core API 无法使用 SSL 浏览器抛出 ERR_CONNECTION_RESET

[英]ASP.Net Core API won't work using SSL browser throws ERR_CONNECTION_RESET

I'm building an API in Visual Studio using ASP.NET Core Web Application, but since a couple of days ago it doesn't work anymore.我正在使用 ASP.NET 核心 Web 应用程序在 Visual Studio 中构建 API 应用程序,但几天前它不再工作了。 When I run the API from Visual Studio using IIS Express I get an error in the browser: "ERR_CONNECTION_RESET".当我使用 IIS Express 从 Visual Studio 运行 API 时,我在浏览器中收到错误:“ERR_CONNECTION_RESET”。

The application does work when I disable SSL, but it should (and before did) work with SSL enabled.当我禁用 SSL 时,该应用程序确实可以工作,但它应该(和之前)在启用 SSL 的情况下工作。

Things I've tried:我尝试过的事情:

  • Change port (within the correct range)更改端口(在正确范围内)
  • Delete localhost certificate and repair Visual Studio, prompting the creation of a new SSL certificate删除localhost证书并修复Visual Studio,提示新建SSL证书
  • Deleted the.VS file and restarted VS in administrator mode删除.VS文件并以管理员模式重新启动VS
  • Delete applicationhost.config and restarted VS in administrator mode删除 applicationhost.config 并以管理员模式重新启动 VS
  • Created a fresh application with a working pre build WeatherAPI, but that has the same problem aswel使用工作预构建的 WeatherAPI 创建了一个新应用程序,但也有同样的问题
  • Ran SSL Diagnostics using Jexus and got the following使用 Jexus 运行 SSL 诊断并得到以下结果
System Time: 18/06/2020 14:40:58 Processor Architecture: AMD64 OS: Microsoft Windows NT 10.0.18363.0 Server Type: IIS Express SERVER SSL PROTOCOLS PCT 1.0: PCT 1.0 is not secure. OS default is used. You might explicitly disable it via registry. SSL 2.0: SSL 2.0 is not secure. OS default is used. You might explicitly disable it via registry. SSL 3.0: SSL 3.0 is not secure. OS default is used. You might explicitly disable it via registry. TLS 1.0: TLS 1.0 is not secure. OS default is used. You might explicitly disable it via registry. TLS 1.1: TLS 1.1 is not secure. OS default is used. You might explicitly disable it via registry. TLS 1.2: SChannel EventLogging: 1 (hex) To tune TLS related settings, please follow https://support.microsoft.com/en-us/kb/187498 or try out IIS Crypto from https://www.nartac.com/Products/IISCrypto/. Microsoft documentation on cipher suites can be found at https://docs.microsoft.com/en-us/windows/desktop/secauthn/cipher-suites-in-schannel. ----- [W3SVC/1] ServerComment: WebSite1 ServerAutoStart: True ServerState: Stopped BINDING: http *:8080:localhost

For what it's worth I've also checked for the subkeys through Regedit, but couldn't find the subkeys inside HKey_Local_Machine\System\CurrentControlSet\Control\SecurityProviders \SCHANNEL\Protocols\对于它的价值,我还通过 Regedit 检查了子项,但在HKey_Local_Machine\System\CurrentControlSet\Control\SecurityProviders \SCHANNEL\Protocols\中找不到子项

I am completely at a loss what it could be我完全不知所措

Edit: Tried it on another PC, on which it seems to work properly编辑:在另一台 PC 上尝试过,它似乎可以正常工作

According to the binding configuration from the report, there is no https binding in your project.根据报告中的绑定配置,您的项目中没有 https 绑定。

BINDING: http *:8080:localhost绑定:http *:8080:localhost

Please ensure you checked the option of configuring HTTPS binding while creating the AspDotNET CoreAPI project.请确保您在创建 AspDotNET CoreAPI 项目时选中了配置 HTTPS 绑定的选项。
在此处输入图像描述
This will add additional code snippets to Startup.cs file.这将向Startup.cs文件添加额外的代码片段。

//Adding middlewares for redirecting HTTP request to HTTPS
            app.UseHttpsRedirection();

And additional HTTPS binding configuration in launchSettings.json file.以及launchSettings.json文件中的附加 HTTPS 绑定配置。
在此处输入图像描述
Besides, most of the browsers start to support TLS1.2 only, please ensure that TLS1.2 is not disabled.此外,大部分浏览器开始只支持 TLS1.2,请确保没有禁用 TLS1.2。
Feel free to let me know if the problem still exists.如果问题仍然存在,请随时告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 安装 Visual Studio 2017 Enterprise 后的 ERR_CONNECTION_RESET - ERR_CONNECTION_RESET after installing Visual Studio 2017 Enterprise err_connection_reset VS2019(杀毒问题) - err_connection_reset VS2019 (antivirus problem) BrowserLink工具不适用于ASP.NET Core 2.1? - BrowserLink tooling doesn't work with ASP.NET Core 2.1? VS2019 安装 SQL Server 组件导致浏览网页时出现 err_connection_reset - VS2019 install with SQL Server components causes err_connection_reset when viewing the web 未经修改的ASP.NET Core应用模板不会在Azure中运行 - Unmodified ASP.NET Core app template won't run in Azure Visual Studio不会构建它创建的ASP.NET Core项目 - Visual Studio won't build the ASP.NET Core project it created ASP.NET CORE 标识 DataProtectionTokenProviderOptions 密码重置令牌无效 - ASP.NET CORE Identity DataProtectionTokenProviderOptions Password reset token is invalid ASP.Net 核心 Web API 控制器脚手架失败 - 无法建立连接 - ASP.Net core web API controller Scaffolding failed - The connection could not be established 为什么我的JavaScript无法在ASP.net Web表单中工作? - Why won't my JavaScript work in a ASP.net web form? 无法找到 somepage.azurewebsites.net 页面部署 ASP.NET Core 7 Web API - somepage.azurewebsites.net page can’t be found deployment ASP.NET Core 7 Web API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM