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.
Options

Building a Unity App using HttpClient and ignoring certificates

Hey everyone,
I've build an Unity App for HoloLens which should simply request a JSON from a Webservice via Rest. The thing is, I want to ignore certificate errors (since this is only a prototype). For building in Unity I used this code:

ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;

This is totally fine for Mono but doesn't work in .Net 4.5. Since I'm using the HttpClient for .Net 4.5, I tried using this code for the build for the HoloLens:

var handler = new HttpClientHandler(); handler.ClientCertificateOptions = ClientCertificateOption.Manual; handler.ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) => { return true; };

Which should work, based on various forum posts. But it won't let me build it. I always receive this 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 deactivate the certificate validation? Thanks for you help!

Sign In or Register to comment.