Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Curl error 56: Receiving data failed with unitytls error code 1048578

Discussion in 'Scripting' started by Pool_Programmer, Dec 18, 2021.

  1. Pool_Programmer

    Pool_Programmer

    Joined:
    Jun 20, 2017
    Posts:
    8
    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
    https://forum.unity.com/threads/how...iled-with-unitytls-error-code-1048578.802959/

    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 https://id.unity.com/en/privacy/edit 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.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,945
    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://forum.unity.com/threads/using-unity-for-subscription-lists.1070663/#post-6910289

    https://forum.unity.com/threads/unity-web-request-acting-stupid.1096396/#post-7060150
     
  3. Pool_Programmer

    Pool_Programmer

    Joined:
    Jun 20, 2017
    Posts:
    8
    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?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,945
    You have now exceeded my networking knowledge. :)

    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.
     
  5. Pool_Programmer

    Pool_Programmer

    Joined:
    Jun 20, 2017
    Posts:
    8
    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!
     
    Kurt-Dekker likes this.