Avoid trying to fix the trusted root certificates (#21599)

This commit is contained in:
Javier Calvarro Nelson 2020-05-08 03:41:52 +02:00 committed by GitHub
parent e129d00910
commit cdfa43bbe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -157,8 +157,9 @@ namespace Microsoft.AspNetCore.Certificates.Generation
{ {
var result = EnsureCertificateResult.Succeeded; var result = EnsureCertificateResult.Succeeded;
var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true).Concat( var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true);
ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true)); var trustedCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true);
var certificates = currentUserCertificates.Concat(trustedCertificates);
var filteredCertificates = certificates.Where(c => c.Subject == Subject); var filteredCertificates = certificates.Where(c => c.Subject == Subject);
var excludedCertificates = certificates.Except(filteredCertificates); var excludedCertificates = certificates.Except(filteredCertificates);
@ -177,7 +178,7 @@ namespace Microsoft.AspNetCore.Certificates.Generation
{ {
// Skip this step if the command is not interactive, // Skip this step if the command is not interactive,
// as we don't want to prompt on first run experience. // as we don't want to prompt on first run experience.
foreach (var candidate in certificates) foreach (var candidate in currentUserCertificates)
{ {
var status = CheckCertificateState(candidate, true); var status = CheckCertificateState(candidate, true);
if (!status.Result) if (!status.Result)