ASP.NET Core + IIS Express如何设置SSL证书 [英] ASP.NET Core + IIS Express how to setup SSL Certificate

查看:260
本文介绍了ASP.NET Core + IIS Express如何设置SSL证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在IIS Express上本地运行带有ASP.NET Core的Web API.我们正在使用在hosts文件中配置的自定义域名.

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.

这很好,但是我们必须不时地手动信任Chrome中的网站,因此我们希望将IIS Express设置为使用我们的SSL证书.

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.

在launchSettings.json中配置IIS Express:

IIS Express is configured in launchSettings.json:

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

我们如何配置IIS Express以使用我们的SSL证书?

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

推荐答案

在计算机上安装证书,然后在cmd中运行:

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>

这篇关于ASP.NET Core + IIS Express如何设置SSL证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆