其他分享
首页 > 其他分享> > .NET5 本地境配置https 无需搭建SSL环境

.NET5 本地境配置https 无需搭建SSL环境

作者:互联网

1.修改用Kestrel

 .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseUrls("http://*:5000", "https://*:5001").UseStartup<Startup>();
                    webBuilder.UseKestrel(option =>
                    {
                        option.ConfigureHttpsDefaults(o =>
                        {
                            o.ServerCertificate =
                                new System.Security.Cryptography.X509Certificates.X509Certificate2(@"E:\charger\ssl\Certificate.pfx", "F3ibzYy2"); //证书路径、密码
                        });
                    });
                })

2.用工具CreateCertGU生成crt证书

下载地址 https://download.csdn.net/download/jine515073/18972476

 

 3.转换成pfx  地址:https://www.ssldun.com/tools/ssl-converter.php

 

 4.双击安装证书到信任位置

 

标签:option,证书,SSL,https,webBuilder,download,pfx,NET5
来源: https://www.cnblogs.com/linyijia/p/14799431.html