Hi
I have got a client certificate (.p12 file) for a cloud service. it works with .net regular project - tested in .NET 2.0 as well.
But in Unity it throws an error ** WebException: The remote server returned an error: (403) Forbidden. System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) UnityEngine.EventSystems.EventSystem:Update()** code public void xsOdataCall() { string url = "https://hana-00374-1003053-emea.sapdemocloud.com/zwh_drone/zwh_drone.xsodata/WAREHOUSE"; X509Certificate2 certificate = new X509Certificate2(System.IO.Path.Combine(Application.dataPath, "Resources\\FIORI_ACCESS.p12"), "xxxx"); System.Net.ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) => { return true; }; String encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes("username:password")); HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); req.Headers.Add("Authorization", "Basic " + encoded); if (certificate != null) req.ClientCertificates.Add(certificate); req.ContentType = "application/xml"; req.Accept = "application/xml"; // req.Proxy = new WebProxy("http://proxy:8080"); // req.UserAgent = ".NET Framework"; WebResponse resp = req.GetResponse(); Stream stream = resp.GetResponseStream(); StreamReader sr = new StreamReader(stream, Encoding.UTF8); string json = sr.ReadToEnd(); var obj = Deseriableobject(json); }