Skip to content

Restore TLS certificate validation in Veeam connectors - #14907

Open
idoshabi07 wants to merge 1 commit into
Azure:masterfrom
idoshabi07:ai-scan/veeam-tls
Open

Restore TLS certificate validation in Veeam connectors#14907
idoshabi07 wants to merge 1 commit into
Azure:masterfrom
idoshabi07:ai-scan/veeam-tls

Conversation

@idoshabi07

Copy link
Copy Markdown
Contributor

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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ccff4d4a-3094-4de9-a5c0-d00c63d96a37
@idoshabi07
idoshabi07 requested review from a team as code owners August 13, 2026 12:11
@v-maheshbh v-maheshbh (v-maheshbh) added the Connector Connector specialty review needed label Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 HttpClientHandler without 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() is protected 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 instance protected virtual factory 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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Connector Connector specialty review needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants