dotnet core 3.1 gRPC win7 NotSupportedException: HTTP/2 over TLS is not supported on Windows 7 due

啓動時報了2個錯:

       1、  AggregateException: One or more errors occurred. (HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support.) (HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support.)

       2、NotSupportedException: HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support.

我的解決辦法:

        打開 appsetting.json 文件 ,這部分          

"Kestrel": {
    "EndpointDefaults": {
      "Protocols": "Http2"
    }
  }

   客戶端可以全部刪除,或者刪除 “EndpointDefaults”節點內容。

  服務端可以修改,將“EndpointDefaults”改爲 “EndpointDefults”:例如

"Kestrel": {
    "Endpoints": {
      "Http": {
        "Url": "http://+:5000"
      },
      "Https": {
        "Url": "https://+:5001"
      },
      "Http2": {
        "Url": "http://+:5002",
        "Protocols": "Http2"
      }
    }

其中,5000和5001 都是服務端的啓動端口( launchSetting.json文件中 Profiles:ApplictionUrl 內容)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章