Skip to content

[RecoveryServices] Preserve HTTPS certificate validation in Backup clients - #30262

Merged
NoriZC merged 2 commits into
Azure:mainfrom
ankur741999:fix/recoveryservices-certificate-validation
Oct 14, 2026
Merged

NoriZC merged 2 commits into
Azure:mainfrom
ankur741999:fix/recoveryservices-certificate-validation

Conversation

@ankur741999

@ankur741999 justbelieve (ankur741999) commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

Tests
️✔️ 22/22

Description

Recovery Services Backup client initialization currently replaces ServicePointManager.ServerCertificateValidationCallback with a callback that accepts every certificate. Remove that assignment, the obsolete test-environment comment and analysis suppression, and the unused import.

Initialization now leaves the platform's default certificate validation, or any caller-supplied validation callback, unchanged. This does not introduce another global callback or reset an existing caller policy.

Add regression coverage to the existing Backup test project for both a null callback and a caller-supplied callback. The tests restore the original callback in finally, and the existing test assembly disables parallel execution. Update the upcoming release notes. No cmdlet signatures or module versions are changed.

Validation

dotnet test src\RecoveryServices\RecoveryServices.Backup.Test\RecoveryServices.Backup.Test.csproj --no-restore --filter FullyQualifiedName~ClientProxyBaseTests

Both cases fail against the original constructor and pass with this change (2 passed, 0 failed). The targeted run builds the affected adapter and its project dependencies. No Azure sign-in, live service calls, or traffic interception is required.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Stop replacing the global certificate validation callback during client initialization. Preserve platform and caller policy, add isolated regression coverage, and update release notes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 13:05
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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.

Copilot review overview

🟡 Changes recommended

The regression test lacks the CheckIn trait required for execution in CI.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Removes insecure global certificate-validation override behavior from Recovery Services Backup client initialization.

Changes:

  • Preserves platform or caller-supplied HTTPS certificate validation.
  • Adds regression tests and the adapter project reference.
  • Updates module and repository release notes.
File Description
ChangeLog.md Adds repository-level release note.
src/​RecoveryServices/​RecoveryServices/​ChangeLog.md Adds module release note.
src/​RecoveryServices/​RecoveryServices.Backup.Test/​RecoveryServices.Backup.Test.csproj References the tested adapter project.
src/​RecoveryServices/​RecoveryServices.Backup.Test/​UnitTests/​ClientProxyBaseTests.cs Tests callback preservation.
src/​RecoveryServices/​RecoveryServices.Backup.ServiceClientAdapter/​ClientProxyBase.cs Removes permissive certificate callback assignment.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Comment thread ChangeLog.md Outdated
@NoriZC NoriZC self-assigned this Oct 12, 2026
@github-actions

Copy link
Copy Markdown

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

Tag the regression theory as CheckIn so CI selects both cases. Remove the manual root changelog entry while retaining the module release note.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 09:50
@ankur741999

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Commenter does not have sufficient privileges for PR 30262 in repo Azure/azure-powershell

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.

🟢 Approval recommended

The focused implementation removes the insecure override and includes appropriate CI-enabled regression coverage.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@ankur741999

Copy link
Copy Markdown
Contributor Author

NoriZC The review follow-up is pushed in 8c37a0a; both threads are addressed and resolved, and re-review has been requested. The rebuilt regression run with the CheckIn and platform filters selected exactly two cases, both passing. Azure Pipelines rejected my /azp run request because this account lacks the required PR pipeline privileges. Please authorize/re-run the pipelines for the updated head when reviewing.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

@NoriZC
NoriZC merged commit 19393a3 into Azure:main Oct 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants