此站点无法从 dotnet linux 提供安全连接 asp.net core

Jho*_*les 5 c# linux asp.net-core

我目前正在使用 asp.net core 2.1 开发 API。当我在 Windows 中使用 ide Visual Studio 2019 时,我在运行项目时没有遇到问题,但是现在我使用的是 manjaro linux 并且我使用 dotnet 控制台进行编译时出现错误: 此站点无法提供安全连接 err_ssl_protocol_error

在此处输入图片说明

我见过的大多数解决方案都是使用框架 asp.net 或更改 Visual Studio IDE 的选项制作的,因此我无法在我的项目中实现它。我试过添加:

.UseSetting("https_port", "5000")
Run Code Online (Sandbox Code Playgroud)

在 program.cs 里面,但它没有用

类程序.cs

public static void Main(string[] args)
{
    var host = CreateWebHostBuilder(args).Build();
    RunSeeding(host);//esta llamando el alimentador de la base de datos
    host.Run();
}

private static void RunSeeding(IWebHost host)
{
    var scopeFactory = host.Services.GetService<IServiceScopeFactory>();
    using (var scope = scopeFactory.CreateScope())
    {
        var seeder = scope.ServiceProvider.GetService<SeedDb>();
        seeder.SeedAsync().Wait();
    }
}

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
        .UseSetting("https_port", "5000")
        .UseStartup<Startup>();
Run Code Online (Sandbox Code Playgroud)

configure.cs 类

 public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
    }
    else
    {
        // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
        app.UseHsts();
    }

    app.UseHttpsRedirection();
    app.UseMvc();                


    app.UseCors("AllowSpecificOrigin");


}
Run Code Online (Sandbox Code Playgroud)

bra*_*ter 2

我们目前正在解决在应用服务的容器中运行的 ASP.NET Core 应用程序的一个已知问题。此处描述了此问题,以及我们计划教育社区如何解决当前问题以及我们计划如何长期修复它。可能不相关,但想把它放在这里以防万一。