Skip to content

Commit

Permalink
Ignore ssl cert on websocket client. (#3423)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingluoHuang authored Aug 6, 2024
1 parent 43d67e4 commit 7303cb5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Runner.Common/JobServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Security;
using System.Net.WebSockets;
using System.Text;
using System.Threading;
Expand Down Expand Up @@ -179,6 +180,10 @@ private void InitializeWebsocketClient(TimeSpan delay)
userAgentValues.AddRange(UserAgentUtility.GetDefaultRestUserAgent());
userAgentValues.AddRange(HostContext.UserAgents);
this._websocketClient.Options.SetRequestHeader("User-Agent", string.Join(" ", userAgentValues.Select(x => x.ToString())));
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
{
this._websocketClient.Options.RemoteCertificateValidationCallback = (_, _, _, _) => true;
}

this._websocketConnectTask = ConnectWebSocketClient(feedStreamUrl, delay);
}
Expand Down

0 comments on commit 7303cb5

Please sign in to comment.