dotnet/android

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

Opened this issue · 3 comments

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

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

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.

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