风清月

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>();
        });


关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢