I use this:
WebClient mClient = new WebClient();
mClient.UseDefaultCredentials = false;
mClient.Credentials = new NetworkCredential("Name", "Password");
Uri mUrl = new System.Uri("https://server");
mClient.DownloadDataAsync(mUrl);
mClient.DownloadDataCompleted += MClient_DownloadDataCompleted;`
and i get the error in the headline.
What i do not understand is that if i use the same code in a console application in Visual Studio, i get the expected result! But if i use this code in my android app i get the error in the headline. i tried it on the emulator and with a device.
Using ModernHttpClient didn't work for me. What did work was changing some settings in the Android project. Start by right clicking on the project and selecting Properties.
Android Options > Advanced > HttpClient implementation = Android
Android Options > Advanced > SSL/TLS implementation = Native TLS 1.2+
I'm on Visual Studio 2017.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With