用于演示的Identity Server 4星级ssl证书

时间:2017-11-24 19:25:52

标签: ssl oauth-2.0 identityserver4

是否可以找到与所有Identity Server 4样本兼容的免费星形证书?

1 个答案:

答案 0 :(得分:1)

更改身份服务器配置以使用

 X509Certificate2 signingCertificate = null;
        using (var certStore = new X509Store(storeName: "My",
            storeLocation: StoreLocation.LocalMachine))
        {
            certStore.Open(OpenFlags.ReadOnly);
            signingCertificate = certStore.Certificates.Find(findType: X509FindType.FindByThumbprint,
                findValue: Regex.Replace(input: serverOptions.CertificateThumbPrint, pattern: @"[^\da-zA-z]", replacement: string.Empty).ToUpper(),
                validOnly: true).Count > 0 ?
                certStore.Certificates.Find(findType: X509FindType.FindByThumbprint,
                findValue: Regex.Replace(input: serverOptions.CertificateThumbPrint, pattern: @"[^\da-zA-z]",
                replacement: string.Empty).ToUpper(),
                validOnly: true)[0] : null;
        }


    .AddSigningCredential(signingCertificate)