Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question UnityWebRequest on Xbox - 'Destination host has an erroneous SSL certificate' error

Discussion in 'Scripting' started by Sunomo, Oct 20, 2023.

  1. Sunomo

    Sunomo

    Joined:
    Apr 18, 2015
    Posts:
    7
    Hello,
    I've tried searching in the Unity/Xbox forums but nothing as yet seems to solve my problem.

    What I'm trying to do is seemingly very simple and I guess there's some obvious things I'm missing.

    I'm developing a game in Unity for Xbox One. In it, I'm making a call out to a 3rd party website to obtain leaderboard information and return it - to be displayed on the screen. In the Unity Editor it all works fine - the data is returned with no errors. Once I deploy this to my Xbox One dev kit, I get the following error:
    "Destination host has an erroneous SSL certificate"

    The code I have for this is as follows:

    public IEnumerator SendWebRequest()
    {
    UnityWebRequest www = UnityWebRequest.Get("https://www.blahblahblah.com");
    yield return www.SendWebRequest();
    utils.WebRequestResult = string.Format("Response Code:{0}, Error Text:{1}, DownloadHander:{2}", www.responseCode, www.error, www.downloadHandler.text);
    }

    My calling code consists of:
    void Start()
    {
    StartCoroutine(SendWebRequest());
    }

    I'm checking the value of utils.WebRequestResult which contains the string as above.

    Running this on the PC in the Unity Editor works fine - www.downloadHandler.text contains all the data I need and there's no errors. After deploying this to the Xbox One devkit www.error contains the error "Destination host has an erroneous SSL certificate".

    The website does indeed have a correct security certificate.

    What else am I missing for the code above to get this to work on the Xbox?

    Thanks, Ian.
     
  2. Sunomo

    Sunomo

    Joined:
    Apr 18, 2015
    Posts:
    7
    Does anyone have any answers to this one? I'm still having this issue which must be an easy one to fix?
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,239
    Did you try the target endpoint in an online SSL checker?

    There may be other restrictions as far as certs on the XBox... that will be in their documentation.
     
  4. Sunomo

    Sunomo

    Joined:
    Apr 18, 2015
    Posts:
    7
    Thanks @Kurt-Dekker (apologies for the very late reply!). I've checked it with an online SSL checker and it works fine.

    Possibly some progress, but still having issues - when I've enabled Fiddler on my Xbox One dev kit (using these instructions: https://learn.microsoft.com/en-us/windows/uwp/xbox-apps/uwp-fiddler) and run the game on it, everything works perfectly - the data comes back with no errors. I can see in Fiddler on my PC that it tunnels correctly to the URL and returns data.

    When I switch off Fiddler from Xbox dev kit and run the same build I get the "erroneous SSL certificate" error - as if the Xbox can't communicate correctly over the internet. Is there something else I'm missing in terms of setup? Either on the Xbox itself or in Partner Center?
     
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,239
    What happens if you put TWO fiddlers / charleses in a row... what does the one closer to the gateway show you that is different from when you have the FIRST fiddler going or not?

    What this sort of thing could be is far outside my wheelhouse. I imagine something with certs and chains of trust perhaps changing, or else who knows what. Sorry, not a network guy.
     
  6. Sunomo

    Sunomo

    Joined:
    Apr 18, 2015
    Posts:
    7
    Thanks @Kurt-Dekker - it's definitely outside my wheelhouse too. I've followed the various guides that Xbox guys have sent over in terms of config setup, network setup, partner center setup - nothing seems to work.

    Not sure if there's a firewall issue but I've opened up the ports they said to.

    Am really at a loss here. There must be something bleedingly obvious that I'm missing, but I really don't know what it might be.