C#: Introduce null checks in the NugetPackageRestorer.

This commit is contained in:
Michael Nebel
2024-12-09 10:11:49 +01:00
parent 083533a673
commit 547af6c3c9

View File

@@ -604,6 +604,10 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
{
httpClientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, _) =>
{
if (chain is null || cert is null)
{
return false;
}
chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
chain.ChainPolicy.CustomTrustStore.Add(this.dependabotProxy.Certificate);
return chain.Build(cert);