Curl error 56: Receiving data failed with unitytls error code 1048578 (865675)

The Problem:
I’m getting this error:
Curl error 56: Receiving data failed with unitytls error code 1048578

I’m making a web post request to a database via SOAP. When I try making the same request to a placeholder Postman API, I can get a response, but to the server that matters, I get this error. I don’t get the error when going through a standalone C# project, but I do get it when I call the same code from Unity.

Standalone C# + Postman = no problem
Standalone C# + SOAP database = no problem
Unity + SOAP database = curl error 56

What I Have Tried:
I have read this post here

I have boiled down my code to both a standalone C# project and an empty Unity project that only has this database communication code.

I tried disabling analytics in the editor, both in the editor and by going to Unity ID to change the settings. I rebooted the editor and I still get this error.

I’ve rewritten the database code using a backbone of an auto-generated WSDL C# script, using the HttpWebRequest class, and using the HttpClient class. All three options work in standalone C#. The auto-generated WSDL C# script times out after nearly 2 minutes and the other two methods return that curl error 56. Additionally, I’ve tried rewriting everything using the UnityWebRequest class as a base. Still, curl error 56.

All my test calls to Postman work fine from both standalone C# and from Unity, but from Unity to my database gives me this error.


Please, if someone could tell me that I just missed a checkbox in the Unity editor or a boolean script variable somewhere and it solves my issue, I would be ecstatic. Any help is appreciated.

What’s the difference in the wire traffic look like?

Setting up a proxy can be very helpful too, in order to compare traffic:

https://support.unity.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity

Networking, UnityWebRequest, WWW, Postman, curl, WebAPI, etc:

https://discussions.unity.com/t/831681/2

https://discussions.unity.com/t/837672/2

Thank you for this very helpful information! I downloaded CharlesProxy to gather some more information and, interestingly, using it as an SSL Proxy to view my network traffic better causes my calls from Unity to my SOAP database to go through properly. When I have the SSL Proxy turned off, the calls still error out. What would this mean?

You have now exceeded my networking knowledge. :slight_smile:

Some things to look into: perhaps the SSL chain is not 100% kosher? There are online SSL checkers that can tell you if things are wonky. I used one when something was only failing on Android, and turns out it was a bad cert, and only Android was strict enough to care in that case. IOS and Desktop had no problem with it, which seemed odd.

Ah dang! Well, the CharlesProxy program you recommended gave me a much needed source of information that I can work with. I’ll look around at the certificates for issues as well. Thank you for that recommendation and your help!

1 Like