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:
Xamarin.Android.Net.AndroidMessageHandler clientHandler
//for message handlerServicePointManager.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();