4

Using VS 17.3 Preview 1, .Net Maui Blazor, I can't get httpclient or webrequest to work at all in Android. I've tried all the android option project settings (blank, managed, Android, legacy), also tls blank and 1.2 . I've tried various workarounds:

  1. Xamarin.Android.Net.AndroidMessageHandler clientHandler //for message handler

  2. ServicePointManager.CheckCertificateRevocationList = false; ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

I've tried all these different combinations form the Android emulator and also on an android device.

The closet I've come is with webrequest: status: UnknownError message: The SSL connection could not be established, see inner exception.

Has anyone managed to make an https call? Any ideas or suggestions?
Thanks in advance, Rich


WebRequest request = WebRequest.Create("https://fonts.googleapis.com"); // any https site
request.Method = "POST";                                      
string postData = win;  
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();

1 Answers1

0

Yes, I have been able to get it to work without issues. This should help. .Net Maui Blazor - Does HttpClient or WebRequest work at all?

I still cannot get Maui Android to work with ServiceModel connection. The app will compile and run on windows and ios without incident but not Android.