wp8 after adding cert build error does not exit.

0 votes
my earlier feedback about ServicePointManager not found is solved after adding using System.Net. 
But attempt to build to push to device compile stage failed due to:
Error building Player: Exception: Error: type `System.Security.Cryptography.X509Certificates.X509Chain` doesn't exist in target framework. It is referenced from Assembly-CSharp.dll at System.Boolean appA42serviceManager::validator(System.Object,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors).
Error: type `System.Net.Security.SslPolicyErrors` doesn't exist in target framework. It is referenced from Assembly-CSharp.dll at System.Boolean appA42serviceManager::validator(System.Object,System.Security.Cryptography.X509Certificates.X509Certificate,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors).
 
 
daniel
asked May 13, 2014 in App42 Cloud API-BaaS by mrdaniel (10 points)

1 Answer

0 votes

As I already told thatX509Certificates validator is only for Unity_Editor. Don't use them when making the build for WP8 because the windows phone 8 plateform doesn't support it. That's why i place the #if UNITY_EDITOR condition in the scripts. 

So use the X509Certificates validator like this :-

#if UNITY_EDITOR
public static bool Validator (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
         {return true;}
#endif
void Start ()
{
#if UNITY_EDITOR
   ServicePointManager.ServerCertificateValidationCallback = Validator;
#endif
App42API.Initialize("API_KEY","SECRET_KEY");
}

If you have any further issue, then you can comment in the same thread, there is no need to open new thread.

Thanx.

answered May 13, 2014 by Akshay.Mishra (179 points)
ok got it going previously i'd missed out the #if-endif block for the static method.
thanks.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...