asp.net appsettings.json文件添加 Kestrel

复制代码
"Kestrel": {
    "Endpoints": {
      "Https": {
        "Url": "https://localhost:5101",
        "Certificate": {
          "Path": "./localhost.pfx",
          "Password": "123456"
        }
      }
    }
  }
复制代码

自签名开发证书生成

1、检查本地计算机上是否存在受信任的开发证书

dotnet dev-certs https --check --trust

2、删除本地计算机上已存在的任何开发证书

dotnet dev-certs https --clean

3、创建并信任证书

3.1、dotnet dev-certs https --trust

3.2、appsettings.json 配置

"Urls": "https://localhost:44338"

4、创建证书、信任证书并将其导出到 PFX 文件

dotnet dev-certs https -ep ./localhost.pfx -p 123456 --trust

参考

posted @   邪不压正!  阅读(353)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
点击右上角即可分享
微信分享提示