Restore TLS certificate validation in Veeam connectors - #14907
Open
idoshabi07 wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ccff4d4a-3094-4de9-a5c0-d00c63d96a37
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Restores default TLS certificate validation in the Veeam VONE/VBR connectors by removing accept-all certificate callbacks and adding unit tests to prevent regressions.
Changes:
- Removed the custom “accept any cert” validation callback paths (including deleting the unreachable callback implementation).
- Updated VONE client construction to use a default
HttpClientHandlerwithout custom certificate validation. - Added unit tests to assert platform TLS validation is used for both VBR and VONE clients.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Solutions/Veeam/Data Connectors/AzureFunctionVeeam/Veeam.Sentinel.FunctionApp/Client/CertificateValidation.cs | Deletes the unused/unreachable custom certificate validation class. |
| Solutions/Veeam/Data Connectors/AzureFunctionVeeam/Veeam.Sentinel.FunctionApp/Client/AuthenticatedVoneClientHandler.cs | Removes accept-all cert callback and centralizes handler creation. |
| Solutions/Veeam/Data Connectors/AzureFunctionVeeam/Veeam.Sentinel.FunctionApp/Client/AuthenticatedVbrClientHandler.cs | Removes custom remote certificate validation callback wire-up. |
| Solutions/Veeam/Data Connectors/AzureFunctionVeeam/Veeam.Sentinel.FunctionApp.Tests/Client/TlsValidationShould.cs | Adds tests asserting no custom TLS validation callbacks are set. |
| Solutions/Veeam/Data Connectors/AzureFunctionVeeam/Veeam.Sentinel.FunctionApp.Tests/Client/TestableAuthenticatedVoneClientHandler.cs | Adds a testable wrapper to call handler factory method. |
| Solutions/Veeam/Data Connectors/AzureFunctionVeeam/Veeam.Sentinel.FunctionApp.Tests/Client/TestableAuthenticatedVbrClientHandler.cs | Exposes whether VBR RestClient has a custom cert callback configured. |
Suppressed comments (1)
Solutions/Veeam/Data Connectors/AzureFunctionVeeam/Veeam.Sentinel.FunctionApp/Client/AuthenticatedVoneClientHandler.cs:93
CreateHttpClientHandler()isprotected static, which makes it harder to customize behavior via subclassing (static methods can’t be overridden) and forces tests to add a derived type solely to expose it. If the intent is extensibility and testability, consider making it an instanceprotected virtualfactory method or injecting a handler/factory (e.g., via constructor) so tests can validate the actual handler used without needing a special wrapper class.
protected static VoneConfiguration CreateVoneConfig(string baseUrl)
{
var handler = CreateHttpClientHandler();
var httpClient = new HttpClient(handler)
{
BaseAddress = new Uri(baseUrl)
};
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| [Test] | ||
| public void UsePlatformCertificateValidationForVbr() | ||
| { | ||
| Assert.That(AuthenticatedClientHandler.HasCustomServerCertificateValidationCallback, Is.False); |
Comment on lines
+103
to
+106
| protected static HttpClientHandler CreateHttpClientHandler() | ||
| { | ||
| return new HttpClientHandler(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes accept-all certificate callbacks from the VONE and VBR clients, restores platform TLS validation, deletes the unreachable custom callback, and adds targeted tests.
AI scan items
Validation
Test execution requires private Veeam packages that are unavailable from the configured package sources.