Merge pull request #21605 from dotnet-maestro-bot/merge/release/5.0-preview4-to-master

[automated] Merge branch 'release/5.0-preview4' => 'master'
This commit is contained in:
John Luo 2020-05-08 16:50:06 -07:00 committed by GitHub
commit 72bfa8fda7
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 certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true).Concat(
ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true));
var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, 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 excludedCertificates = certificates.Except(filteredCertificates);
@ -177,7 +178,7 @@ namespace Microsoft.AspNetCore.Certificates.Generation
{
// Skip this step if the command is not interactive,
// 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);
if (!status.Result)