HttpWebRequest to https on Android?

What I’m doing is beyond the capability of WWW.

Sending an HttpWebRequest to an https URL works fine on iOS but on Android I get:

System.Net.WebException: Error getting response stream (Write: The authentication or decryption has failed.)

I can get past this error if I return true from a RemoteCertificateValidationCallback, but this is basically ignoring security, which doesn’t seem like the right thing to do. I tried UniWeb and it just returns true too, it doesn’t check anything.

Looking further into RemoteCertificateValidationCallback, it reports a PartialChain error, probably because it can’t find any certificates to validate the one that it received on the server. Opening the X509Stores, there are 0 certificates under Current User and Local Machine.

What do you do to talk to web services over http on Android?

Thanks, @Curyous! I’ve been using UniWeb, which is cross platform, but doesn’t seem to be getting along with GET requests with custom headers used for authentication on Android (works fine on iOS, Mac, Windows and WebPlayer). I conditionally compiled so that if I’m on Android, I just use the WWW class and use UniWeb for other targets.