[6.1.7 Cherry-pick] Fix | Perform ServerCertificate pin validation to verify with server provided cert - #4584
Open
github-actions[bot] wants to merge 1 commit into
Open
Conversation
…provided cert (#4445) * Server Certificate validation changes * Address comments * Address review feedback: reorder pin check after policy checks - Perform ServerCertificate pin validation after chain/name policy error handling, making the additive semantics explicit in control flow. - Extract ValidateCertificatePin/LoadValidationCertificate helpers so the loaded pin certificate lives in a narrow 'using' scope (no try/finally). - Guard against a null server certificate in the pin path. - Clarify method docs on the policyErrors relationship and reword the no-pin fast-path trace message. - Replace ambiguous 'platform trust' wording in docs with chain-and-name validation, and note that pinning does not itself confer trust. - Add TempCertFile disposable test helper and a null-server-cert regression test for the policyErrors == None case. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Revert to minimal design: pin always consulted, fail closed on load error Restores the original semantic where an exact ServerCertificate match satisfies certificate validation. The only behavior changes remain: - The policyErrors == None fast path now also requires that no ServerCertificate was supplied, so a configured certificate is always compared against the one presented by the server. - A ServerCertificate that cannot be loaded/parsed now fails the connection instead of being silently ignored. Also keeps the non-design fixes: the loaded certificate is disposed via a narrow using scope, and a null server certificate throws AuthenticationException instead of NullReferenceException. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Address review: dedicated string, RemoteCertificateNotAvailable guard, safe Dispose - Add SQL_ServerCertificateNotAvailable so the failure names the option in play rather than reusing the generic policy-error text. - A matching ServerCertificate no longer satisfies validation when RemoteCertificateNotAvailable is reported. The flag and a null serverCert are expected to agree, but both are now checked so the contradictory combination cannot be accepted via comparison. Documented the relationship on the method. - Guard TempCertFile.Dispose so a cleanup failure cannot mask a real assertion failure. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
paulmedynski
enabled auto-merge (squash)
August 24, 2026 17:06
paulmedynski
approved these changes
Aug 24, 2026
Contributor
|
/azp run |
benrr101
approved these changes
Aug 24, 2026
|
Azure Pipelines: Successfully started running 2 pipeline(s). 3 pipeline(s) were filtered out due to trigger conditions. |
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.
Cherry-pick of #4445 (8acf068) into
release/6.1.