Skip to content

Commit d719021

Browse files
committed
Fix build break
1 parent 3d93e1d commit d719021

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Servers/Kestrel/Core/src/KestrelServerOptions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ private void EnsureDefaultCert()
142142
var logger = ApplicationServices.GetRequiredService<ILogger<KestrelServer>>();
143143
try
144144
{
145-
var certificateManager = new CertificateManager();
146-
DefaultCertificate = certificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true)
145+
DefaultCertificate = CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true)
147146
.FirstOrDefault();
148147

149148
if (DefaultCertificate != null)

src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void EnsureCreateHttpsCertificate_CreatesACertificate_WhenThereAreNoHttps
5252
Assert.NotNull(exportedCertificate);
5353
Assert.False(exportedCertificate.HasPrivateKey);
5454

55-
var httpsCertificates = _manager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: false);
55+
var httpsCertificates = CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: false);
5656
var httpsCertificate = Assert.Single(httpsCertificates, c => c.Subject == TestCertificateSubject);
5757
Assert.True(httpsCertificate.HasPrivateKey);
5858
Assert.Equal(TestCertificateSubject, httpsCertificate.Subject);
@@ -94,7 +94,7 @@ public void EnsureCreateHttpsCertificate_CreatesACertificate_WhenThereAreNoHttps
9494
httpsCertificate.Extensions.OfType<X509Extension>(),
9595
e => e.Critical == false &&
9696
e.Oid.Value == "1.3.6.1.4.1.311.84.1.1" &&
97-
e.RawData[0] == _manager.AspNetHttpsCertificateVersion);
97+
e.RawData[0] == CertificateManager.AspNetHttpsCertificateVersion);
9898

9999
Assert.Equal(httpsCertificate.GetCertHashString(), exportedCertificate.GetCertHashString());
100100

@@ -137,7 +137,7 @@ public void EnsureCreateHttpsCertificate_DoesNotCreateACertificate_WhenThereIsAn
137137
now = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, 0, now.Offset);
138138
_manager.EnsureAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1), path: null, trust: false, subject: TestCertificateSubject);
139139

140-
var httpsCertificate = _manager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject);
140+
var httpsCertificate = CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject);
141141

142142
// Act
143143
var result = _manager.EnsureAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1), CertificateName, trust: false, includePrivateKey: true, password: certificatePassword, subject: TestCertificateSubject);
@@ -164,9 +164,9 @@ public void EnsureCreateHttpsCertificate_ReturnsExpiredCertificateIfVersionIsInc
164164
now = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, 0, now.Offset);
165165
_manager.EnsureAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1), path: null, trust: false, subject: TestCertificateSubject);
166166

167-
_manager.AspNetHttpsCertificateVersion = 2;
167+
CertificateManager.AspNetHttpsCertificateVersion = 2;
168168

169-
var httpsCertificateList = _manager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
169+
var httpsCertificateList = CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
170170
Assert.Empty(httpsCertificateList);
171171
}
172172

@@ -178,12 +178,12 @@ public void EnsureCreateHttpsCertificate_ReturnsExpiredCertificateForEmptyVersio
178178

179179
DateTimeOffset now = DateTimeOffset.UtcNow;
180180
now = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, 0, now.Offset);
181-
_manager.AspNetHttpsCertificateVersion = 0;
181+
CertificateManager.AspNetHttpsCertificateVersion = 0;
182182
_manager.EnsureAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1), path: null, trust: false, subject: TestCertificateSubject);
183183

184-
_manager.AspNetHttpsCertificateVersion = 1;
184+
CertificateManager.AspNetHttpsCertificateVersion = 1;
185185

186-
var httpsCertificateList = _manager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
186+
var httpsCertificateList = CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
187187
Assert.Empty(httpsCertificateList);
188188
}
189189

@@ -195,10 +195,10 @@ public void EnsureCreateHttpsCertificate_ReturnsValidIfVersionIsZero()
195195

196196
DateTimeOffset now = DateTimeOffset.UtcNow;
197197
now = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, 0, now.Offset);
198-
_manager.AspNetHttpsCertificateVersion = 0;
198+
CertificateManager.AspNetHttpsCertificateVersion = 0;
199199
_manager.EnsureAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1), path: null, trust: false, subject: TestCertificateSubject);
200200

201-
var httpsCertificateList = _manager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
201+
var httpsCertificateList = CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
202202
Assert.NotEmpty(httpsCertificateList);
203203
}
204204

@@ -210,11 +210,11 @@ public void EnsureCreateHttpsCertificate_ReturnValidIfCertIsNewer()
210210

211211
DateTimeOffset now = DateTimeOffset.UtcNow;
212212
now = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, 0, now.Offset);
213-
_manager.AspNetHttpsCertificateVersion = 2;
213+
CertificateManager.AspNetHttpsCertificateVersion = 2;
214214
_manager.EnsureAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1), path: null, trust: false, subject: TestCertificateSubject);
215215

216-
_manager.AspNetHttpsCertificateVersion = 1;
217-
var httpsCertificateList = _manager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
216+
CertificateManager.AspNetHttpsCertificateVersion = 1;
217+
var httpsCertificateList = CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
218218
Assert.NotEmpty(httpsCertificateList);
219219
}
220220

@@ -241,10 +241,10 @@ public void EnsureAspNetCoreHttpsDevelopmentCertificate_CanRemoveCertificates()
241241

242242
_manager.CleanupHttpsCertificates(TestCertificateSubject);
243243

244-
Assert.Empty(_manager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: false).Where(c => c.Subject == TestCertificateSubject));
244+
Assert.Empty(CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: false).Where(c => c.Subject == TestCertificateSubject));
245245
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
246246
{
247-
Assert.Empty(_manager.ListCertificates(CertificatePurpose.HTTPS, StoreName.Root, StoreLocation.CurrentUser, isValid: false).Where(c => c.Subject == TestCertificateSubject));
247+
Assert.Empty(CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.Root, StoreLocation.CurrentUser, isValid: false).Where(c => c.Subject == TestCertificateSubject));
248248
}
249249
}
250250
}

src/Tools/dotnet-dev-certs/src/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private static int CheckHttpsCertificate(CommandOption trust, IReporter reporter
150150
{
151151
var now = DateTimeOffset.Now;
152152
var certificateManager = new CertificateManager();
153-
var certificates = certificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
153+
var certificates = CertificateManager.ListCertificates(CertificatePurpose.HTTPS, StoreName.My, StoreLocation.CurrentUser, isValid: true);
154154
if (certificates.Count == 0)
155155
{
156156
reporter.Output("No valid certificate found.");
@@ -164,7 +164,7 @@ private static int CheckHttpsCertificate(CommandOption trust, IReporter reporter
164164
if (trust != null && trust.HasValue())
165165
{
166166
var store = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? StoreName.My : StoreName.Root;
167-
var trustedCertificates = certificateManager.ListCertificates(CertificatePurpose.HTTPS, store, StoreLocation.CurrentUser, isValid: true);
167+
var trustedCertificates = CertificateManager.ListCertificates(CertificatePurpose.HTTPS, store, StoreLocation.CurrentUser, isValid: true);
168168
if (!certificates.Any(c => certificateManager.IsTrusted(c)))
169169
{
170170
reporter.Output($@"The following certificates were found, but none of them is trusted:

0 commit comments

Comments
 (0)