Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Problems with UnityWebRequest + Https + IL2CPP on Windows

Discussion in '2018.2 Beta' started by MatthewScott, Apr 26, 2018.

  1. MatthewScott

    MatthewScott

    Joined:
    Aug 25, 2008
    Posts:
    40
    Hi there,

    I spent all day troubleshooting this to try and provide a good test case.

    We are playing with the new IL2CPP scripting engine for Windows, and in most cases it works amazing!

    Except when you try to close the app, it crashes and hangs. You have to use the TaskManager to force quit the app.

    I tried making a Visual Studio project to see if I could debug it, and some exceptions occurred in the TLS/SSL encryption classes.

    Trial and error revealed that if we prevent the game from making any https:// webrequests then (for the most part) the app closes normally. It is worth pointing out that we successfully load AssetBundles fine over Https. And when I tried creating a specific test case (http://google.com vs https://google.com) the game crashed in both cases. I suspect the http site is redirecting to https.

    Also the game closes fine using the Mono .Net 2.0 scripting engine. I only get the lockup trying to close or Application.Quit() under IL2CPP.

    Searching the forums, I found issues reported with TLS, but nothing under IL2CPP.

    Is this something you have seen reported before?

    Thanks,
    Matt
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Hi Matthew,
    Could you please submit a bug report with a minimal reproduction project for the issues you're experiencing and reply in here with the case #?
     
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Also, note that TLS is not supported in Unity 2018.1 yet. Support for all platforms is available in 2018.2 beta releases though.
     
  4. MatthewScott

    MatthewScott

    Joined:
    Aug 25, 2008
    Posts:
    40
    Hi there,

    Please pull down the test project here.
    https://www.dropbox.com/s/aikbtr4ro2koyt3/unitywebrequest-test.zip?dl=0

    This is a simple scene that runs about 6 lines of code when you click the "Do Test" button to start a coroutine and use a UnityWebRequest to pull down the contents of http://google.com (not even https). If you build this app for Windows using the IL2CPP backend, it crashes when you try to exit the app.

    I've upgraded to the latest 2018.2.0b2 just to make sure this is still an issue.

    Thanks,
    Matt
     
  5. MatthewScott

    MatthewScott

    Joined:
    Aug 25, 2008
    Posts:
    40
    Submitted as a bug through the Editor too.
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Thanks for submitting a bug report - we will investigate this.
     
  7. amateurd

    amateurd

    Joined:
    Nov 1, 2016
    Posts:
    97
    Same result here, works fine with Mono but hangs on closing with IL2CPP. In my case I'm only getting the problem when I use a CertificateHandler on the UnityWebRequest. Apologies if this relates to something else.
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Can you submit a bug report? Your issue might be slightly different, but it is still something we want to investigate.
     
  9. amateurd

    amateurd

    Joined:
    Nov 1, 2016
    Posts:
    97
    Submitted just now, thanks.
     
    JoshPeterson likes this.
  10. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Thanks a lot for the report! For future references, please reference the Issue ID of your bug reports when you're talking about them on the forums. That enables us and others to access them directly without having to search for it. In this case it's not necessary, since I already found it:

    1051739