Skip to content

Commit

Permalink
C#: Introduce null checks in the NugetPackageRestorer.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnebel committed Dec 9, 2024
1 parent aea3312 commit 790c7d0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,10 @@ private bool IsFeedReachable(string feed, int timeoutMilliSeconds, int tryCount,
{
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);
Expand Down

0 comments on commit 790c7d0

Please sign in to comment.