Click here to Skip to main content
15,906,558 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
please help me for import p12 file certificate in c#

What I have tried:

How can I use p12 file with password in project?
i have cert.p12 file & I need to use it in my project.
Posted
Updated 25-Jul-18 7:59am

1 solution

webHostBuilder = webHostBuilder.UseKestrel(options =>
                 {

                     options.Listen(IPAddress.Loopback, 4431, listenOptions =>
                     {
                         listenOptions.NoDelay = true;
                         listenOptions.UseHttps(new Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionAdapterOptions()
                         {
                             SslProtocols = SslProtocols.Tls,
                             CheckCertificateRevocation = false,
                             ClientCertificateMode = ClientCertificateMode.AllowCertificate,
                             ServerCertificate = new System.Security.Cryptography.X509Certificates.X509Certificate2(@"local.pfx", "intel@123")
                         });

                     });
                 })
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900