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

Improve gRPC support on mobile platforms #69095

Closed
5 tasks done
steveisok opened this issue May 10, 2022 · 11 comments
Closed
5 tasks done

Improve gRPC support on mobile platforms #69095

steveisok opened this issue May 10, 2022 · 11 comments
Assignees
Labels
area-Infrastructure-mono os-android os-ios Apple iOS os-maccatalyst MacCatalyst OS os-tvos Apple tvOS User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@steveisok
Copy link
Member

steveisok commented May 10, 2022

In .NET 7 we would like to better support the .NET gRPC client on iOS and Android so that MAUI apps can take advantage.

  • Bring up gRPC interop tests
  • AOT and trim gRPC client. Identify and fix any issues
  • Identify and fix any issues with the interop tests
  • Support calling gRPC servers with self-signed certs
  • Performance test gRPC client on all mobile platforms
@steveisok steveisok added os-android area-Infrastructure-mono os-ios Apple iOS os-tvos Apple tvOS User Story A single user-facing feature. Can be grouped under an epic. os-maccatalyst MacCatalyst OS labels May 10, 2022
@steveisok steveisok added this to the 7.0.0 milestone May 10, 2022
@ghost
Copy link

ghost commented May 10, 2022

Tagging subscribers to 'arch-android': @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Issue Details

In .NET 7 we would like to support the .NET gRPC client on iOS and Android so that MAUI apps can take advantage.

  • Bring up gRPC interop tests
  • AOT and trim gRPC client. Identify and fix any issues
  • Identify and fix any issues with the interop tests
  • Support calling gRPC servers with self-signed certs
  • Performance test gRPC client on all mobile platforms
Author: steveisok
Assignees: -
Labels:

os-android, area-Infrastructure-mono, os-ios, os-tvos, User Story, os-maccatalyst

Milestone: 7.0.0

@steveisok
Copy link
Member Author

@simonrozsival @akoeplinger In the past, we've dismissed shipping any custom java class as part of the Android runtime pack. Should we reconsider in order to support self-signed certs with SocketsHttpHandler?

@JamesNK
Copy link
Member

JamesNK commented May 17, 2022

Related issue: #69464

Note that gRPC-Web works over HTTP/1.1. More details: https://docs.microsoft.com/en-us/aspnet/core/grpc/supported-platforms?view=aspnetcore-6.0

@simonrozsival
Copy link
Member

I found a problem with full AOT on Android that has alread been solved on Apple platforms: #55736, #55947

@janseris
Copy link

janseris commented Jun 10, 2022

@steveisok @simonrozsival
This issue surprises me.
Why is it not possible to use a gRPC client in MAUI now with .NET 6?
gRPC client is a part of .NET 6. It seemed to me like what can .NET 6 do, can MAUI do as well.
Is there any official list of features from .NET 6 which are not platform specific but MAUI cannot use it?
I didn't think MAUI cannot use gRPC client on Android.

So far I have discovered that EF Core 6 cannot do any DB calls from Android 8.1 and lower because of a pre-login SSL handshake issue.

@steveisok
Copy link
Member Author

The title is correct. I'll change the description to include "better support".

@simonrozsival
Copy link
Member

There have been several improvements to the gRPC support on Android in .NET 7 (bugfix #69507 which enables AOT compilation on Android, CI setup in #73060) but we still need more time to finish this issue (especially the iOS part) and there's not enough time to finish it in time for .NET 7. I'm moving further improvements (mostly infrastructure related) to .NET 8.

@simonrozsival simonrozsival modified the milestones: 7.0.0, 8.0.0 Aug 15, 2022
@janseris
Copy link

janseris commented Aug 15, 2022

@simonrozsival Thanks, does this mean gRPC Client will be available for Android with .NET 7 or will be together with iOS on .NET 8?

@simonrozsival
Copy link
Member

@janseris the gRPC Client is an independent NuGet package (https://www.nuget.org/packages/Grpc.Net.Client). It already works with .NET 6 on Android and iOS. In .NET 7, ahead of time compilation on Android will be fixed. We'll also run the interop tests on Android emulators. In .NET 8 we'll further improve our CI infrastructure to ensure the gRPC client works correctly on Android and iOS devices.

@ComptonAlvaro
Copy link

When I start to try gRPC with MAUI and .NET I had hope to can use the same client library for all kind of clients, MAUI, WPF and so on.

But but the moment, I am having problems with self signed certificates. I can make it work in windows applications, but if I try to use MAUI / Android, I get an error:

"HttpRequestException: The SSL connection could not be established, see inner exception. AuthenticationException: Authentication failed, see inner exception. SslException: Exception of type 'Interop+AndroidCrypto+SslException' was thrown.", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
 ---> Interop+AndroidCrypto+SslException: Exception of type 'Interop+AndroidCrypto+SslException' was thrown."

When I knew that MAUI will use .NET 6 I thought I could use the same libraries in all my projects, but I but the moment I can't finde the way to do.

If it could be improve this aspect, it would be very nice.

@janseris
Copy link

janseris commented Aug 22, 2022

@ComptonAlvaro MAUI has this type of problems when connecting to SQL Server as well. It probably has something to do with underlying SSL provider or implementation. There have been also problems with WebSocket etc. Noone seems to be going towards any fix so far.
dotnet/SqlClient#1662
dotnet/SqlClient#1656

#83118

When MAUI was in preview, there existed a configuration in .csproj where you could change SSL/TLS implementation but that has disappeared since official release and I think it didn't help me establishing connection to SQL Server in Android 8.0 and lower anyways.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-mono os-android os-ios Apple iOS os-maccatalyst MacCatalyst OS os-tvos Apple tvOS User Story A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

No branches or pull requests

5 participants