您好,欢迎来到知库网。
搜索
您的当前位置:首页asp.net core 中布署 https ( Kestrel

asp.net core 中布署 https ( Kestrel

来源:知库网
  1. 准备证书 (购买 或 自己生成)
    假设为 localhost.pfx,保存到某个目录。
    假设密码为 password。
  1. 添加依赖引用(project.json)
 "Microsoft.AspNet.Server.Kestrel.Https": ****
  1. 添加侦听端口(project.json)
"web": "Microsoft.AspNet.Server.Kestrel --server.urls=http://*:8000;https://*:44300"
  1. 加载证书 (startup.cs)
// Configure 
var sslCert = new  "Certs/localhost.pfx"), "password");
app.UseKestrelHttps( sslCert);

Copyright © 2019- zicool.com 版权所有 湘ICP备2023022495号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务