diff --git a/src/Agent.Sdk/Util/VssUtil.cs b/src/Agent.Sdk/Util/VssUtil.cs index a1d1d278e8..4fa56eec6e 100644 --- a/src/Agent.Sdk/Util/VssUtil.cs +++ b/src/Agent.Sdk/Util/VssUtil.cs @@ -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; @@ -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)) {