是否可以找到与所有Identity Server 4样本兼容的免费星形证书?
答案 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)