Validating a certificate in Hololens
I am currently building a project for Hololens, using Visual Studio and Unity3D. This project uses external dll's, among which RestSharp and Manatee.Json. My application uses those libraries to make calls to Trello's API in C#.
Curently, my project runs perfectly on Unity's "Play mode". However, when I try to build the project, I get the following error :
Assets\Scripts\Controller\RestController.cs(25,9): error CS0103: The name 'ServicePointManager' does not exist in the current context
Here is the incriminated line :
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
I believe I get the error because ServicePointManager
is not part of .net Core, which is my build target.
I tried removing this line entirely, and the project manages to build properly. However, at runtime I get the following error :
TlsException: Invalid certificate received from server. Error code: 0xffffffff80092012
Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates)
Googling the error yield solutions using the ServicePointManager.ServerCertificateValidationCallback
method, which I can't use do due to .net Core restrictions.
What is the proper way to validate my certificate for Hololens ?
Curent Settings:
Unity 5.5.1f1 & HoloToolkit v 1.5.5.0
Build settings : SDK Universal 10, Target device Hololens, Build Type D3D
Compilation override : Use Net Core
On all my DLL's : Checkbox "Don't Process" ticked
Hey, I have the exact same problem that I can't use the ServicePoint$$anonymous$$anager. Did you find any solution to this? Thanks!