Subscribe to Feed

21Dec

How to enable SSL on IIS 7.0 programmatically?

Posted by admin as .Net, Asp.Net, IIS7, Windows

 

You can use Microsoft.Web.Administration namespace to create a binding and set the certificate hash. Let us say you are trying to add a new binding to a website “MySite” with a new SSL certificate hash “MyCertHash”, here is what you have to do to achieve this

ServerManager serverManager = new ServerManager();
serverManager.Sites["MySite"].Bindings.Add("*.443:", MyCertHash, "MyCert");

The bindings member configures binding information for an IIS 7.0 Web site. You can also add multiple bindings to a website or use similar approach to add other bindings.

Comment Form

 

 

Subscribe to Feed

Categories

Links

Dev Jobs