- Home /
UNITYTLS_X509VERIFY_NOT_DONE in ios phone,UNITYTLS_X509VERIFY_NOT_DONE
I am using Https Post in unity project.In my working project,it works in editor(when platform is windows,android or ios)and Android phone but not ios phone.When I copy these code to a new project,it works in ios phone!.I changed the playersetting of the new project to the same as working project,but it works still. The error occurs in “using (Stream requestStream = request.GetRequestStream())”. Anyone knows how to solve this error?Is this error related to project settings? The main error is "UNITYTLS_X509VERIFY_NOT_DONE".
codes:
byte[] bytes = Encoding.GetEncoding("utf-8").GetBytes(sendData);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(myRequestUrl);
request.ClientCertificates.Add(mCert);
request.Method = "POST";
request.ServerCertificateValidationCallback = CertificateCallBack;
using (Stream requestStream = request.GetRequestStream())
{
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
}
...
static bool CertificateCallBack(object sender,X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
}
...
errors:
System.Net.WebException: Error: SecureChannelFailure (One or more errors occurred.) ---> System.AggregateException: One or more errors occurred. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Mono.Security.Interface.TlsException: Handshake failed - error code: UNITYTLS_INTERNAL_ERROR, verify result: UNITYTLS_X509VERIFY_NOT_DONE at Mono.Unity.Debug.CheckAndThrow (Mono.Unity.UnityTls+unitytls_errorstate errorState, Mono.Unity.UnityTls+unitytls_x509verify_result verifyResult, System.String context, Mono.Security.Interface.AlertDescription defaultAlert) [0x00000] in :0 at Mono.Unity.UnityTlsContext.ProcessHandshake () [0x00000] in :0 at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncOperationStatus status) [0x00000] in :0 at Mono.Net.Security.MobileAuthenticatedStream.InnerRead (System.Boolean sync, System.Int32 requestedSize, System.Threading.CancellationToken cancellationToken) [0x00000] in :0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in :0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in :0 at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction (System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask) [0x00000] in :0 at System.Threading.Tasks.Task.FinishContinuations () [0x00000] in :0
...
Your answer
Follow this Question
Related Questions
Problems with HTTPS, HttpWebRequest, and iOS? 4 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Https certificate error exception (self-signed) 1 Answer
Manually validating SSL certificates (no WWW involved) 1 Answer
unity xcode an error occurred during export codesign failed 1 Answer