Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/Servers/Kestrel/Core/src/Internal/LoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ internal static partial class LoggerExtensions

[LoggerMessage(7, LogLevel.Error, "The certificate key file at '{CertificateKeyFilePath}' can not be found, contains malformed data or does not contain a PEM encoded key in PKCS8 format.", EventName = "MissingOrInvalidCertificateKeyFile")]
public static partial void FailedToLoadCertificateKey(this ILogger<KestrelServer> logger, string certificateKeyFilePath);

[LoggerMessage(8, LogLevel.Warning, "The ASP.NET Core developer certificate is not trusted. For information about trusting the ASP.NET Core developer certificate, see https://aka.ms/aspnet/https-trust-dev-cert.", EventName = "DeveloperCertificateNotTrusted")]
public static partial void DeveloperCertificateNotTrusted(this ILogger<KestrelServer> logger);
}
5 changes: 5 additions & 0 deletions src/Servers/Kestrel/Core/src/KestrelServerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ private void EnsureDefaultCert()
}

logger.LocatedDevelopmentCertificate(DefaultCertificate);

if (!CertificateManager.Instance.IsTrusted(DefaultCertificate))
{
logger.DeveloperCertificateNotTrusted();
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ protected override bool IsExportable(X509Certificate2 c)

internal override CheckCertificateStateResult CheckCertificateState(X509Certificate2 candidate, bool interactive)
{
// Return true as we don't perform any check.
return new CheckCertificateStateResult(true, null);
}

Expand Down