This commit is contained in:
parent
3f808160dd
commit
a2effc56e0
|
|
@ -29,6 +29,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
|
|||
foundCertificate = foundCertificates
|
||||
.OfType<X509Certificate2>()
|
||||
.Where(IsCertificateAllowedForServerAuth)
|
||||
.Where(DoesCertificateHaveAnAccessiblePrivateKey)
|
||||
.OrderByDescending(certificate => certificate.NotAfter)
|
||||
.FirstOrDefault();
|
||||
|
||||
|
|
@ -80,6 +81,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https.Internal
|
|||
return !hasEkuExtension;
|
||||
}
|
||||
|
||||
internal static bool DoesCertificateHaveAnAccessiblePrivateKey(X509Certificate2 certificate)
|
||||
=> certificate.HasPrivateKey;
|
||||
|
||||
private static void DisposeCertificates(X509Certificate2Collection certificates, X509Certificate2 except)
|
||||
{
|
||||
if (certificates != null)
|
||||
|
|
|
|||
Loading…
Reference in New Issue