Skip to content

[tests] Re-enable AndroidMessageHandler ServerCertificateCustomValidationCallback tests#11972

Open
simonrozsival wants to merge 1 commit into
dotnet:mainfrom
simonrozsival:dev/simonrozsival/reenable-servercert-validation-tests
Open

[tests] Re-enable AndroidMessageHandler ServerCertificateCustomValidationCallback tests#11972
simonrozsival wants to merge 1 commit into
dotnet:mainfrom
simonrozsival:dev/simonrozsival/reenable-servercert-validation-tests

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Summary

Re-enables the five AndroidMessageHandler.ServerCertificateCustomValidationCallback_* device tests that were [Ignore]d in #11801.

They were disabled because a boolean-returning SSL validation callback crashed the test process with a native SIGSEGV under the trimmable typemap (CoreCLR/NativeAOT) mid-handshake:

  • ServerCertificateCustomValidationCallback_ApproveRequest
  • ServerCertificateCustomValidationCallback_RejectRequest
  • ServerCertificateCustomValidationCallback_ApprovesRequestWithInvalidCertificate
  • ServerCertificateCustomValidationCallback_IgnoresCertificateHostnameMismatch
  • ServerCertificateCustomValidationCallback_Redirects

Why they pass now

The root cause was fixed in #11802: the trimmable typemap generator now matches each n_* callback MemberRef to its binding's real boolean/char signature, so the [UnmanagedCallersOnly] forwarder no longer "will always throw" and the SSL validation callback dispatches correctly.

Verification

Built the local SDK on top of current main (which includes both #11802 and the reflection-free trimmable managers from #11801) and ran the SSL-category device tests on an arm64 emulator with -p:_AndroidTypeMapImplementation=trimmable -p:UseMonoRuntime=false.

All five re-enabled tests pass (as does the never-ignored NoServerCertificateCustomValidationCallback_ThrowsWhenThereIsCertificateHostnameMismatch); overall SSL run: 0 failed. CI validates the full runtime matrix (CoreCLR / Mono / CoreCLRTrimmable / NativeAOT).

…tionCallback tests

These five `ServerCertificateCustomValidationCallback_*` device tests were
`[Ignore]`d in dotnet#11801 because a boolean-returning SSL validation callback
crashed the test process with a native SIGSEGV under the trimmable typemap
(CoreCLR/NativeAOT) mid-handshake.

The root cause was fixed in dotnet#11802: the trimmable typemap generator now
matches each `n_*` callback `MemberRef` to its binding's real boolean/char
signature, so the `[UnmanagedCallersOnly]` forwarder no longer "always
throws" and the callback dispatches correctly.

Verified locally on an arm64 emulator with
`-p:_AndroidTypeMapImplementation=trimmable -p:UseMonoRuntime=false`: all
five re-enabled tests (plus the never-ignored
`NoServerCertificateCustomValidationCallback_*`) pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 3, 2026 18:41
@simonrozsival simonrozsival added copilot `copilot-cli` or other AIs were used to author this trimmable-type-map labels Jul 3, 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

Re-enables previously ignored on-device SSL tests for AndroidMessageHandler.ServerCertificateCustomValidationCallback_*, restoring coverage for certificate validation callback behavior now that the underlying trimmable-typemap crash has been addressed upstream.

Changes:

  • Removes [Ignore] from five ServerCertificateCustomValidationCallback_* device tests so they run again under the SSL test fixture category.
Show a summary per file
File Description
tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs Removes [Ignore] attributes to re-enable five SSL callback device tests.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot `copilot-cli` or other AIs were used to author this ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). trimmable-type-map

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants