- Home /
Question by
janlovsin · Sep 10, 2019 at 07:06 PM ·
certificate
SSL certificate
I'm using the following code to accept all certificates.
class AcceptAllCertificatesSignedWithASpecificKeyPublicKey : CertificateHandler
{
// Encoded RSAPublicKey
private static string PUB_KEY = "mypublickey";
protected override bool ValidateCertificate(byte[] certificateData)
{
X509Certificate2 certificate = new X509Certificate2(certificateData);
string pk = certificate.GetPublicKeyString();
if (pk.ToLower().Equals(PUB_KEY.ToLower()))
return true;
return true;
}
}
and then I set for each UnityWebRequest connection:
uwr.certificateHandler = new AcceptAllCertificatesSignedWithASpecificKeyPublicKey();
But the above only works for Android while for iOS it spits out "unable to complete SSL connection". Any ideas?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612211956im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
HttpWebRequest.GetRequestStream() https certificate error exception 6 Answers
WWW with HTTPS on Android not working 0 Answers
Combine 3 Files into a .pfx programatically 0 Answers
how to get Sha1 certificat 1 Answer
Online certification 0 Answers