C#: Address review comments.

This commit is contained in:
Michael Nebel
2024-12-10 13:13:11 +01:00
parent 86c6df5cbd
commit 684c80c31a

View File

@@ -606,7 +606,12 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
{
if (chain is null || cert is null)
{
logger.LogWarning("Certificate validation trivially failed due to missing chain or certificate.");
var msg = cert is null && chain is null
? "certificate and chain"
: chain is null
? "chain"
: "certificate";
logger.LogWarning($"Dependabot proxy certificate validation failed due to missing {msg}");
return false;
}
chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;