AppService监听器中的数字证书CN名称和主机名
创始人
2024-11-10 08:00:22
0

使用以下代码示例来指定数字证书的CN名称和主机名。将示例中的“cn_name”和“hostname”替换为实际的CN名称和主机名。

using System.Security.Authentication;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Https;

public class Program
{
    public static void Main(string[] args)
    {
        var host = new WebHostBuilder()
            .UseKestrel(options =>
            {
                options.Listen("localhost", 5000, listenOptions =>
                {
                    listenOptions.UseHttps(new HttpsConnectionAdapterOptions
                    {
                        ServerCertificate = CertificateHelper.LoadFromStoreCert("cn_name", "My", StoreLocation.CurrentUser, allowInvalid: true),
                        ClientCertificateMode = ClientCertificateMode.RequireCertificate,
                        ClientCertificateValidation = CertificateHelper.ValidateClientCertificate,
                        SslProtocols = SslProtocols.Tls12,
                        CheckCertificateRevocation = true,
                        ClientCertificateCollection = CertificateHelper.LoadFromStoreCerts("My", StoreLocation.CurrentUser)
                    });
                });
            })
            .UseStartup()
            .Build();

        host.Run();
    }
}

相关内容

热门资讯

透视ai代打!破解辅助插件we... 透视ai代打!破解辅助插件wepoker(透视)其实是有挂(详细辅助线上教程);辅助器中分为三种模型...
解密关于!werplan外挂,... 解密关于!werplan外挂,wepoker可以透视码,详细教程(有挂攻略);致您一封信;亲爱wep...
透视了解!impoker辅助(... 透视了解!impoker辅助(透视)确实是真的有挂(详细辅助wepoke教程)在进入辅助挂后,参与本...
一分钟了解!悦扑克脚本,aap... 一分钟了解!悦扑克脚本,aapoker插件,AI教程(有挂方法);玩家必备必赢加哟《13670430...
透视辅助!wepokerplu... 透视辅助!wepokerplus万能挂(透视)确实存在有挂(详细辅助2025教程);1、玩家可以在软...
玩家必看科普!hhpoker有... 玩家必看科普!hhpoker有透视功能吗,德州局HHpoker透视脚本,攻略方法(有挂技巧);小薇(...
透视私人局!大菠萝免费辅助(透... 透视私人局!大菠萝免费辅助(透视)本来是有挂(详细辅助科技教程)1、玩家可以在软件透明挂俱乐部对游戏...
总算了解!pokeplus脚本... 这是一款非常优秀的pokeplus脚本 ia辅助检测软件,能够让你了解到pokeplus脚本中牌率当...
透视工具!pokemmo手机脚... 透视工具!pokemmo手机脚本(透视)竟然存在有挂(详细辅助爆料教程)一、软件透明挂的定义与意义1...
一分钟了解!竞技联盟破解版最新... 这是一款非常优秀的竞技联盟破解版最新版 ia辅助检测软件,能够让你了解到竞技联盟破解版最新版中牌率当...