Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Building a Unity App using httpclient and ignoring certificates

Hey everyone,
I'm trying to build a Unity App to HoloLens which should request a JSON from a Webservice via Rest. The thing is, I want to allow unknown and incorrect certificates. For building in Unity, I therefore us this code:

ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
The code works fine in Mono, but for .Net 4.5 it doesn't compile. So in that case I use this code instead:

handler = new HttpClientHandler(); handler.ClientCertificateOptions = ClientCertificateOption.Manual; handler.ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) => { return true; };
Which should do the same, based on various forum posts. But everytime I try to build for HoloLens I get the following error:

'HttpClientHandler' does not contain a definition for 'ServerCertificateCustomValidationCallback' and no extension method 'ServerCertificateCustomValidationCallback' accepting a first argument of type 'HttpClientHandler' could be found (are you missing a using directive or an assembly reference?)

Is it simply not possible at the moment to turn off the validation or is there another option?




Sign In or Register to comment.