Search Unity

[2018.3, UWP Mobile] Https UnityWebRequest "Unknown error"

Discussion in 'Windows' started by Tr3gan, Jan 9, 2019.

  1. Tr3gan

    Tr3gan

    Joined:
    Dec 13, 2016
    Posts:
    11
    Hey there,

    So I've started upgrading our project from Unity 5.6 to 2018.3, and everything seems to be working fine, except our windows phone builds. Whenever I build our app as UWP Mobile/ARM/Xaml, all requests fail with a statuscode 0 & "unknown error" message. I've then made a repro project and I checked if I could reproduce the issue in there.

    Http requests work fine, https requests always fail, so it seems that UnityWebRequest doesn't work properly with SSL certificates on UWP.

    Is there any known workaround for this? I'll report a bug with the repro project attached as well.

    Yours,
    Bas
     
  2. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    408
    Yeah, that's a known problem in Mono in which SSL is "broken" (at least in the older version).

    Try changing the Configuration to use .NET 4.x (located in Player Settings->Other Settings), which I think will fix the problem.
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
  4. Tr3gan

    Tr3gan

    Joined:
    Dec 13, 2016
    Posts:
    11
    Double-checked the repro project that I made, and it's already on .NET 4.x: upload_2019-1-10_8-49-46.png

    Yes it does! Both x86 and x64 work fine. I also tried changing the scripting backend to .NET, but the result stays the same.

    I'm not sure if you guys have access to Fogbugz, but the case is 1115472
     

    Attached Files:

    Last edited: Jan 10, 2019
  5. Tr3gan

    Tr3gan

    Joined:
    Dec 13, 2016
    Posts:
    11
    What I've noticed is that there were updates for our test device (Nokia Lumia 735), which wouldn't install. There were some more weird things going on with the device, like I couldn't download anything from the Store, so I flashed a clean OS on it.

    I'm currently updating the device, and after every update I check if the issue is still there. So far I've tested the repro project on Windows 10 1511 and 1607, and on both of these the issue occurs. Will update this post as the device gets more up-to-date.

    -EDIT-
    There was 1 more update available after going to 1607 (also 1607... nice...), and that one seems to have solved the issue. Repro project now no longer gives "Unknown error", but a proper response as expected! Going to check in our main project tomorrow, but this probably means that the issue is gone.
     
    Last edited: Jan 10, 2019
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Is there any chance the time was set incorrectly on the device? It could cause issues like that.
     
  7. Tr3gan

    Tr3gan

    Joined:
    Dec 13, 2016
    Posts:
    11
    I actually checked that, because one of my colleagues mentioned it, but date/time was set correctly (automatic date/time/timezone, and correct when I checked)

    I literally only installed the available updates for the device and the repro project worked again. Couldn't find a changelog for that one patch, so can't check what exactly was changed.

    I performed the following steps to get to this point:
    1. Flashed Windows 8.1 firmware RM-1038 VAR EURO NL CV (product code 059W5R1)
    2. Installed Upgrade Advisor app from the Store
    3. Upgraded OS to Windows 10 1511
    4. Built & Deployed the repro app => Unknown error
    5. Updated OS to Windows 10 1607
    6. Built & Deployed the repro app => Unknown error
    7. Updated OS again, seemed to be some kind of patch because build is still 1607
    8. Built & Deployed the repro app => Success
    I sadly don't have a test device at home, so I'll report back tomorrow with hopefully good news that the main project works fine again.
     
  8. Tr3gan

    Tr3gan

    Joined:
    Dec 13, 2016
    Posts:
    11
    Yep, main project seems to work fine again! So yay, seems like a Windows 10 issue that has been fixed in later versions of the OS. Weird that it only shows up in Unity 2018.3 though, our app worked fine in 5.6.5.
     
  9. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    2018.3 is where we started to fully support HTTPS in UnityWebRequest. Before that on Desktop we didn't validate certificates against trusted store, effectively trusting all valid certificates.
     
    Tr3gan likes this.