ASP.NET Core + IIS Express how to setup SSL Certificate

本秂侑毒 提交于 2019-12-23 17:41:25

问题


We are running a web API with ASP.NET Core on IIS Express locally. We are using a custom domain name configured in the hosts-file.

This works fine, but we have to manually trust the site in Chrome every now and then, so we would like to set IIS Express up to use our SSL-certificate.

IIS Express is configured in launchSettings.json:

"iisExpress": {
  "applicationUrl": "http://applocal.ourdomain.com:5000",
  "sslPort": 44300
}

How can we configure IIS Express to use our SSL Certificate?


回答1:


Install the certificate on the machine, then run in cmd:

"C:\Program Files (x86)\IIS Express\IisExpressAdminCmd.exe" setupSslUrl -url:https://my.domain.name:<port> -CertHash:<Certificate thumbprint>



回答2:


Jexus Manager provides you the user interface to add server certificates and change site bindings.

http://jexusmanager.com




回答3:


You should import this certificate to Trusted Root Certification Authorities on each machine you run this App. Easiest way to do this is open this certificate directly from browser. Not sure about Chrome and Firefox, but it works for IE for sure.



来源:https://stackoverflow.com/questions/38894814/asp-net-core-iis-express-how-to-setup-ssl-certificate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!