Install SSL certificate programmatically using Microsoft.Web.Administration

前端 未结 7 1760
执念已碎
执念已碎 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:16

    I feel like it's important to highlight Devator's comment in this answer. There appears to be a bug that prevents the certificate changes from taking place and I would never have solved it without seeing this comment.

    If you set the binding information to itself, this causes IIS to bind the certificate. A quick example is shown below:

    binding.BindingInformation = binding.BindingInformation;

提交回复
热议问题