Install SSL certificate programmatically using Microsoft.Web.Administration

前端 未结 7 1689
执念已碎
执念已碎 2020-12-28 20:11

So the Microsoft.Web.Administration API is very easy to use to create HTTP and HTTPS bindings for sites:

using (ServerManager manager = new          


        
7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-28 20:30

    There is a method overload for adding Bindings that will add the certificate to HTTP.sys correctly, see: http://msdn.microsoft.com/en-us/library/bb355650(v=VS.90).aspx

    Optionally you can actually set the binding settings:

    binding.CertificateHash and binding.CertificateStoreName and when commiting it will register correctly with HTTP.sys: http://msdn.microsoft.com/en-us/library/microsoft.web.administration.binding_properties(v=VS.90).aspx

提交回复
热议问题