Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak which tests get run on .NET 6 Android #1505

Merged
merged 3 commits into from
Apr 4, 2023

Conversation

borrrden
Copy link
Member

@borrrden borrrden commented Mar 29, 2023

Actual code fixes in EE repo. The status is that dynamically generated X509 certificates will never function until .NET 8. Static certificates not trusted by default will need a network security config entry. Intermediate certificate pinning is also not going to work, and no fix for that seems to be scheduled yet.

Ref: dotnet/runtime#84202 and dotnet/runtime#45741

Actual code fixes in EE repo
Very little functions as it should in .NET 6, and there are two specific large workarounds needed. First of all, none of this works without first either having a certificate issued by a CA trusted by default on Android, or adding in a trusted CA via network security config XML.  This creates a temporary contract that by the time the certificate reaches this callback, it is already trusted anyway...so a lot of this is just yak shaving until .NET 8.

1. When operating in normal mode (not "only self signed"), ask the underlying Java API is the certificate is trusted or not because X509Chain does not seem aware of everything that the Java API is aware of (specifically network security config trusted certificates).  This may or may not change in .NET 8, but for now at least it lines up with the fact that this is already trusted purely by the fact that it made it into this callback
2. When operating in self signed only mode, work around the non-functioning X509Chain by looking at the leaf cert directly (there is only supposed to be one entry anyway.  If it is self signed, that means there are no more certs in the chain)
@borrrden borrrden requested review from bmeike and jianminzhao April 4, 2023 02:26
@bmeike
Copy link
Contributor

bmeike commented Apr 4, 2023

Is this something we need to document? Should we create a ticket, right now, to remove these exceptions?

@borrrden
Copy link
Member Author

borrrden commented Apr 4, 2023

We will absolutely need to document the life out of this. .NET 6 iOS and Android will need their own quirks and shortcomings section (respectively). I'll try to find the appropriate place to put a docs comment.

As for a ticket we can file it but it will remain blocked for probably months.

@borrrden borrrden merged commit 4d2c0cb into release/3.1 Apr 4, 2023
@borrrden borrrden deleted the fix/cbl-4371_tls_identity branch April 4, 2023 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants