Home > front end >  Setting localhost certificate to be iis express development certificate
Setting localhost certificate to be iis express development certificate

Time:10-29

I understand I can use IIS to set the certificate for the website running on localhost to IIS Express Development Certificate...

But how would I do this programmatically using a c# and .net program running on the individuals machine?

Or even using powershell.. or a cmd script.. just in a programmatic way that can be executed

CodePudding user response:

Tim Buntrock posted an article on 4sysOps to run one locally for SQL Server. The self-signing concept should be the same.

https://4sysops.com/archives/create-a-self-signed-certificate-with-powershell/#:~:text=Tim Buntrock is one of three enterprise administrators,certificate you sign with your own private key.

CodePudding user response:

netsh is the simplest command line you can use to associate certificates to ports and DNS names (SNI),

https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-configure-a-port-with-an-ssl-certificate

You can also consume Windows HTTP API in C#, or use IISAdministration PowerShell cmdlets. Examples can be found via search engines.

  • Related