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

Different behavior between net8.0-android34.0 and net8.0-windows10.0 during TSL handshake #9272

Open
NeuralDip opened this issue Aug 31, 2024 · 3 comments
Assignees
Labels
Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc.

Comments

@NeuralDip
Copy link

Android framework version

net8.0-android

Affected platform version

VS2022, 17.11.0, Xamarin 17.11.0.93, System.ServiceModel 6.0.0

Description

I am attaching a VS22 project with which you can reproduce the problem.
MAUITestCase.zip
It is a MAUI project, on net8 and is trying to connect to a WCF service that uses SSL.
The problem is that running the application on windows or on Android have different behaviour inside the System.ServiceModel library

unfortunately i cannot step into the NET libraries and debug for some other reason (another case reported on visual studio support), but we still have an inconsistency between NET versions.

The other attachments that you will find are the following:

the packets exchanged during line 46 execution in the desktop version recorded by WireShark
the packets exchanged during line 46 execution in the android version recorded by WireShark
the complete exception thrown

Please let me know if you need more information
desscktop.txt
mobile.txt
URI.txt

Steps to Reproduce

  1. Load the project on visual studio
  2. run the project on windows to confirm that there is no exception thrown on line 46 of file MAUITestCase\App.xaml.cs.
  3. repeat by running on android to catch the URI exception from line 46 as in the image:
    URI_Android

Did you find any workaround?

no

Relevant log output

Please look into description
@NeuralDip NeuralDip added Area: App Runtime Issues in `libmonodroid.so`. needs-triage Issues that need to be assigned. labels Aug 31, 2024
@NeuralDip
Copy link
Author

Please use this Project, as the WCF service has changed name:
MAUITestCase.zip

@grendello grendello assigned simonrozsival and unassigned grendello Sep 2, 2024
@grendello grendello added Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc. and removed Area: App Runtime Issues in `libmonodroid.so`. needs-triage Issues that need to be assigned. labels Sep 2, 2024
@simonrozsival
Copy link
Member

Hello @NeuralDip. The TLS implementation is using the operating system's APIs and so the Windows and Android implementations behave slightly differently. The exception doesn't seem to indicate that the problem is in the TLS handshake but rather in the WCF protocol itself when the XML parser isn't able to parse some URI. Could you please share that XML that causes the issue?

Alternatively, try setting <UseNativeHttpHandler>false</UseNativeHttpHandler> in your app's project file to force the WCF client to use SocketsHttpHandler on all platforms for better cross-platform consistency.

@NeuralDip
Copy link
Author

NeuralDip commented Sep 5, 2024

Hi @simonrozsival , thank you for your reply.
Unfortunately i do not have the XML as i cannot step into the library for some issue with VS.
the UseNativeHttpHandler flag did not change anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc.
Projects
None yet
Development

No branches or pull requests

5 participants
@grendello @simonrozsival @NeuralDip and others