- Home /
SSL stream makes app crash on iOS
I'm using Unity3d 4.5.4f1 to build an app on iOS. It's OK to using ssl stream on editor. But on iOS device(iOS 7.0), app will crash when I try to handshake with server. Code like this:
System.Net.Sockets.TcpClient testtcp = new System.Net.Sockets.TcpClient("myserver", myport);
X509CertificateCollection x509Cert = new X509CertificateCollection();// SslProtocols.Tls, false
X509Certificate newCert = new X509Certificate("rsa_sha1.crt");
x509Cert.Add(newCert);
SslStream testSSL = new SslStream(testtcp.GetStream(),false, delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) {
return true;
});
try
{
testSSL.AuthenticateAsClient("myservername",x509Cert,System.Security.Authentication.SslProtocols.Tls,false);
}
catch (Exception e)
{
}
App will crash when try to AuthenticateAsClient().
In Xcode, when app crash, the Thread is like this
Can you help me with this?
qq20141119-1.png
(152.8 kB)
Comment
Your answer
Follow this Question
Related Questions
Controlling Unity3D PC Application from IPAD/IPHONE 1 Answer
Wait until slowest player loaded... 0 Answers
Unity modules for iOS? 1 Answer
Best way to create/design modular Player 2 Answers
iPhone Controller Asset 0 Answers