Skip to content

Avoid trying to fix the trusted root certificates #21599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Shared/CertificateGeneration/CertificateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ public EnsureCertificateResult EnsureAspNetCoreHttpsDevelopmentCertificate(
{
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);
Expand All @@ -177,7 +178,7 @@ public EnsureCertificateResult EnsureAspNetCoreHttpsDevelopmentCertificate(
{
// 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)
Expand Down