Skip to content

Commit cdfa43b

Browse files
authored
Avoid trying to fix the trusted root certificates (#21599)
1 parent e129d00 commit cdfa43b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Shared/CertificateGeneration/CertificateManager.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ public EnsureCertificateResult EnsureAspNetCoreHttpsDevelopmentCertificate(
157157
{
158158
var result = EnsureCertificateResult.Succeeded;
159159

160-
var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true).Concat(
161-
ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true));
160+
var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true);
161+
var trustedCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true);
162+
var certificates = currentUserCertificates.Concat(trustedCertificates);
162163

163164
var filteredCertificates = certificates.Where(c => c.Subject == Subject);
164165
var excludedCertificates = certificates.Except(filteredCertificates);
@@ -177,7 +178,7 @@ public EnsureCertificateResult EnsureAspNetCoreHttpsDevelopmentCertificate(
177178
{
178179
// Skip this step if the command is not interactive,
179180
// as we don't want to prompt on first run experience.
180-
foreach (var candidate in certificates)
181+
foreach (var candidate in currentUserCertificates)
181182
{
182183
var status = CheckCertificateState(candidate, true);
183184
if (!status.Result)

0 commit comments

Comments
 (0)