NotSupportedException: HTTP/2 over TLS is not supported on Windows 7 due to missing
电脑版发表于:2020/1/30 17:06
.net core grpc报错:NotSupportedException: HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support
是因为win7不支持TLS的原因
解决方法:在Program.cs中配置不包含 TLS 的 HTTP/2 终结点即可
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { //配置不包含TLS的HTTP/2终结点 webBuilder.ConfigureKestrel(options => { options.ListenLocalhost(50001, a => a.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http2); }); webBuilder.UseStartup<Startup>(); });