-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow NO_SSL_VERIFY in RawHttpMessageHandler. #3883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
ServerCertificateValidationCallbackto the transport handler inRawHttpMessageHandleronce per handler for HTTPS requests. - Adds a backing field (
m_appliedServerCertificateValidationCallbackToTransportHandler) to track application of the callback. - Updates
VssUtilto setRawClientHttpRequestSettings.Default.ServerCertificateValidationCallbackalongside 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.UriSchemeHttpsconstant 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/L0to verify that whenGITHUB_ACTIONS_RUNNER_TLS_NO_VERIFYis enabled,RawHttpMessageHandlercorrectly applies theDangerousAcceptAnyServerCertificateValidatorcallback.
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; |
Copilot
AI
May 30, 2025
There was a problem hiding this comment.
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.
No description provided.