簡體   English   中英

ASP.Net Core API 無法使用 SSL 瀏覽器拋出 ERR_CONNECTION_RESET

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

我正在使用 ASP.NET 核心 Web 應用程序在 Visual Studio 中構建 API 應用程序,但幾天前它不再工作了。 當我使用 IIS Express 從 Visual Studio 運行 API 時,我在瀏覽器中收到錯誤:“ERR_CONNECTION_RESET”。

當我禁用 SSL 時,該應用程序確實可以工作,但它應該(和之前)在啟用 SSL 的情況下工作。

我嘗試過的事情:

  • 更改端口(在正確范圍內)
  • 刪除localhost證書並修復Visual Studio,提示新建SSL證書
  • 刪除.VS文件並以管理員模式重新啟動VS
  • 刪除 applicationhost.config 並以管理員模式重新啟動 VS
  • 使用工作預構建的 WeatherAPI 創建了一個新應用程序,但也有同樣的問題
  • 使用 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

對於它的價值,我還通過 Regedit 檢查了子項,但在HKey_Local_Machine\System\CurrentControlSet\Control\SecurityProviders \SCHANNEL\Protocols\中找不到子項

我完全不知所措

編輯:在另一台 PC 上嘗試過,它似乎可以正常工作

根據報告中的綁定配置,您的項目中沒有 https 綁定。

綁定:http *:8080:localhost

請確保您在創建 AspDotNET CoreAPI 項目時選中了配置 HTTPS 綁定的選項。
在此處輸入圖像描述
這將向Startup.cs文件添加額外的代碼片段。

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

以及launchSettings.json文件中的附加 HTTPS 綁定配置。
在此處輸入圖像描述
此外,大部分瀏覽器開始只支持 TLS1.2,請確保沒有禁用 TLS1.2。
如果問題仍然存在,請隨時告訴我。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM