Skip to content

Commit

Permalink
Changing the callback checking for custom certificate validation
Browse files Browse the repository at this point in the history
  • Loading branch information
MantavyaDh committed Dec 19, 2024
1 parent a79a8ef commit b0597f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Agent.Sdk/Util/VssUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.Net.Http;
using System.Net.Security;
using Microsoft.TeamFoundation.DistributedTask.WebApi;
using Microsoft.VisualStudio.Services.Common;
using Microsoft.VisualStudio.Services.WebApi;
Expand Down Expand Up @@ -167,7 +168,7 @@ private static bool CheckSupportOfCustomServerCertificateValidation(ITraceWriter
{
using (var handler = new HttpClientHandler())
{
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; };
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return errors == SslPolicyErrors.None; };

using (var client = new HttpClient(handler))
{
Expand Down

0 comments on commit b0597f4

Please sign in to comment.