I have problem with validating SSL certificate in my Unity game.
I have made simple test code which is:
ServicePointManager.ServerCertificateValidationCallback += ServerCertificateValidationCallback;
private static bool ServerCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}
public void Test()
{
WebClient w = new WebClient();
string downloadString = w.DownloadString("https://encrypted.google.com/");
}
I have implemented this in .NET 4.5 and in Unity (Mono) and the problem is that this certificate is validated properly on .NET, but in Mono I'm getting:
SslPolicyErrors: RemoteCertificateChainErrors
ChainStatus:
PartialChain
RevocationStatusUnknown
OfflineRevocation
Why this happens? Should I set something in Mono additionally to handle that?
Thanks
EV certificates have the most rigorous SSL validation process and, consequently, offer the highest levels of authentication.
Extended Validation (EV) Certificates Extended Validation Certificate follows a strict verification process to a rigorous level and helps to detect phishing websites. Also, it provides a higher level of security than any other type of SSL certificate.
There are three recognized categories of SSL certificate authentication types: Extended Validation (EV) Organization Validation (OV) Domain Validation (DV)
The web server sends a copy of the SSL certificate to the browser. The browser checks the authenticity of the certificate and sends a message to the webserver. In return, the webserver/website sends a digitally signed acceptance for initiating an SSL encrypted session.
The problem is mono doesn't carry any Root CA or CRL, see Why doesn’t Mono includes root certificates. And if you try to develop mobile game, there was a cert load bug, which return incomplete X509Chain and was fixed in Mono 3.6.0.
According to official advices, update unity to Unity2017 will built-in mono 4.5 which solved this annoyed problem. Otherwise you may have to install CA certs manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With