Answers for "how to use tls 1.2 in ASP.Net 5 entity framework core and webbuilder"

C#
0

how to use tls 1.2 in ASP.Net 5 entity framework core and webbuilder

using System.Security.Authentication;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;

public class Program
{
    public static void Main(string[] args) =>
        CreateHostBuilder(args).Build().Run();

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseKestrel(kestrelOptions =>
                {
                    kestrelOptions.ConfigureHttpsDefaults(httpsOptions =>
                    {
                        httpsOptions.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13;
                    });
                });

                webBuilder.UseStartup<Startup>();
            });
}
Posted by: Guest on June-14-2021

Code answers related to "how to use tls 1.2 in ASP.Net 5 entity framework core and webbuilder"

C# Answers by Framework

Browse Popular Code Answers by Language