Skip to content

Commit 99c661f

Browse files
committed
Delete some dead mac-specific code
1 parent 96b9fd5 commit 99c661f

File tree

6 files changed

+8
-13
lines changed

6 files changed

+8
-13
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ internal void Serialize(Utf8JsonWriter writer)
384384
return null;
385385
}
386386

387-
var status = CertificateManager.Instance.CheckCertificateState(cert, interactive: false);
387+
var status = CertificateManager.Instance.CheckCertificateState(cert);
388388
if (!status.Success)
389389
{
390390
// Display a warning indicating to the user that a prompt might appear and provide instructions on what to do in that

src/Shared/CertificateGeneration/CertificateManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public EnsureCertificateResult EnsureAspNetCoreHttpsDevelopmentCertificate(
208208
// as we don't want to prompt on first run experience.
209209
foreach (var candidate in currentUserCertificates)
210210
{
211-
var status = CheckCertificateState(candidate, true);
211+
var status = CheckCertificateState(candidate);
212212
if (!status.Success)
213213
{
214214
try
@@ -735,7 +735,7 @@ internal void RemoveCertificate(X509Certificate2 certificate, RemoveLocations lo
735735
}
736736
}
737737

738-
internal abstract CheckCertificateStateResult CheckCertificateState(X509Certificate2 candidate, bool interactive);
738+
internal abstract CheckCertificateStateResult CheckCertificateState(X509Certificate2 candidate);
739739

740740
internal abstract void CorrectCertificateState(X509Certificate2 candidate);
741741

src/Shared/CertificateGeneration/MacOSCertificateManager.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ internal sealed class MacOSCertificateManager : CertificateManager
7171
"and create a new untrusted developer certificate. " +
7272
"Use 'dotnet dev-certs https --trust' to trust the new certificate.";
7373

74-
public const string KeyNotAccessibleWithoutUserInteraction =
75-
"The application is trying to access the ASP.NET Core developer certificate key. " +
76-
"A prompt might appear to ask for permission to access the key. " +
77-
"When that happens, select 'Always Allow' to grant 'dotnet' access to the certificate key in the future.";
78-
7974
public MacOSCertificateManager()
8075
{
8176
}
@@ -128,7 +123,7 @@ protected override TrustLevel TrustCertificateCore(X509Certificate2 publicCertif
128123
}
129124
}
130125

131-
internal override CheckCertificateStateResult CheckCertificateState(X509Certificate2 candidate, bool interactive)
126+
internal override CheckCertificateStateResult CheckCertificateState(X509Certificate2 candidate)
132127
{
133128
return File.Exists(GetCertificateFilePath(candidate)) ?
134129
new CheckCertificateStateResult(true, null) :

src/Shared/CertificateGeneration/UnixCertificateManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certifi
127127
return certificate;
128128
}
129129

130-
internal override CheckCertificateStateResult CheckCertificateState(X509Certificate2 candidate, bool interactive)
130+
internal override CheckCertificateStateResult CheckCertificateState(X509Certificate2 candidate)
131131
{
132132
// Return true as we don't perform any check.
133133
// This is about checking storage, not trust.

src/Shared/CertificateGeneration/WindowsCertificateManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected override bool IsExportable(X509Certificate2 c)
3939
#endif
4040
}
4141

42-
internal override CheckCertificateStateResult CheckCertificateState(X509Certificate2 candidate, bool interactive)
42+
internal override CheckCertificateStateResult CheckCertificateState(X509Certificate2 candidate)
4343
{
4444
return new CheckCertificateStateResult(true, null);
4545
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private static int CheckHttpsCertificate(CommandOption trust, CommandOption verb
289289
// We never want check to require interaction.
290290
// When IDEs run dotnet dev-certs https after calling --check, we will try to access the key and
291291
// that will trigger a prompt if necessary.
292-
var status = certificateManager.CheckCertificateState(certificate, interactive: false);
292+
var status = certificateManager.CheckCertificateState(certificate);
293293
if (!status.Success)
294294
{
295295
reporter.Warn(status.FailureMessage);
@@ -344,7 +344,7 @@ private static int EnsureHttpsCertificate(CommandOption exportPath, CommandOptio
344344
var certificates = manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, exportPath.HasValue());
345345
foreach (var certificate in certificates)
346346
{
347-
var status = manager.CheckCertificateState(certificate, interactive: true);
347+
var status = manager.CheckCertificateState(certificate);
348348
if (!status.Success)
349349
{
350350
reporter.Warn("One or more certificates might be in an invalid state. We will try to access the certificate key " +

0 commit comments

Comments
 (0)