Skip to content

.net Maui SSLStream.AuthenticateAsClient is throwing exception on Android #7278

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version]
Depending on Android version, an exception is being thrown on the SSLStream.AuthenticateAsClient method on a TcpClient socket communication. On Android 5.1:

Inner Exception: System.PlatformNotSupportedException: Setting an SNI hostname is not supported on this API level.

On Android 10.0:

Inner Exception: Interop+AndroidCrypto+SslException: Exception of type 'Interop+AndroidCrypto+SslException' was thrown

This same logic works fine under Xamarin.Forms apps on Android and under .net Maui windows apps. I've attached sample projects of Visual Studio projects for Xamarin Forms (CommTester) and for .net Maui (MauiCommTester) so you can easily reproduce the problem.

Our mobile apps require use of TCP sockets and using Http REST web services is not an option.

I am using the following version of Visual Studio Preview:

Microsoft Visual Studio Professional 2022 (64-bit) - Preview
Version 17.3.0 Preview 3.0


Original Comments

Feedback Bot on 7/25/2022, 08:05 PM:

(private comment, text removed)

Feedback Bot on 8/3/2022, 02:51 PM:

(private comment, text removed)


Original Solutions

(no solutions)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: HTTPIssues with sockets / HttpClient.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions