Skip to content

Conversation

@TingluoHuang
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings May 30, 2025 22:30
@TingluoHuang TingluoHuang requested a review from a team as a code owner May 30, 2025 22:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for skipping SSL certificate validation in RawHttpMessageHandler when the GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY environment variable is set.

  • Applies the configured ServerCertificateValidationCallback to the transport handler in RawHttpMessageHandler once per handler for HTTPS requests.
  • Adds a backing field (m_appliedServerCertificateValidationCallbackToTransportHandler) to track application of the callback.
  • Updates VssUtil to set RawClientHttpRequestSettings.Default.ServerCertificateValidationCallback alongside the existing setting.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Sdk/Common/Common/RawHttpMessageHandler.cs Apply ServerCertificateValidationCallback on HTTPS transport handlers and track with a flag.
src/Runner.Sdk/Util/VssUtil.cs Configure RawClientHttpRequestSettings for NO_SSL_VERIFY environment variable.
Comments suppressed due to low confidence (2)

src/Sdk/Common/Common/RawHttpMessageHandler.cs:109

  • Use the Uri.UriSchemeHttps constant and a case-insensitive comparison for clarity and consistency, e.g., request.RequestUri.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase).
if (!m_appliedServerCertificateValidationCallbackToTransportHandler && request.RequestUri.Scheme == "https")

src/Sdk/Common/Common/RawHttpMessageHandler.cs:109

  • Add unit tests under Test/L0 to verify that when GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY is enabled, RawHttpMessageHandler correctly applies the DangerousAcceptAnyServerCertificateValidator callback.
if (!m_appliedServerCertificateValidationCallbackToTransportHandler && request.RequestUri.Scheme == "https")

if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
{
VssClientHttpRequestSettings.Default.ServerCertificateValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
RawClientHttpRequestSettings.Default.ServerCertificateValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
Copy link

Copilot AI May 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Update the public README or configuration documentation to mention the new GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY environment variable and its effect on raw HTTP handlers.

Copilot uses AI. Check for mistakes.
@TingluoHuang TingluoHuang enabled auto-merge (squash) May 30, 2025 22:57
@TingluoHuang TingluoHuang disabled auto-merge May 30, 2025 22:58
@TingluoHuang TingluoHuang merged commit acf3f2b into main May 31, 2025
16 checks passed
@TingluoHuang TingluoHuang deleted the users/tihuang/cert branch May 31, 2025 02:48
sirredbeard pushed a commit to sirredbeard/runner that referenced this pull request Jun 11, 2025
sirredbeard pushed a commit to sirredbeard/runner that referenced this pull request Jun 11, 2025
LouisHaftmann pushed a commit to falcondev-oss/github-actions-runner that referenced this pull request Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants