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

wss communication from Unity UWP app on XBox One not working.

Discussion in 'Multiplayer' started by DerrickLau, Sep 9, 2019.

  1. DerrickLau

    DerrickLau

    Joined:
    Sep 29, 2013
    Posts:
    70
    I am able to open a web socket connection using wss://servername when running my .NET standard 2.0 plugin within the Unity 2019.2 editor and as an UWP app on Windows 10, but when I try connecting to wss://servername from my XBox One as an UWP app, I get:

    Exception thrown while initializing CommunicationManager: System.AggregateException: One or more errors occurred. ---> System.Net.WebSockets.WebSocketException: Unable to connect to the remote server ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Mono.Security.Interface.TlsException: Handshake failed - error code: UNITYTLS_INTERNAL_ERROR, verify result: UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED
    at Mono.Unity.UnityTlsContext.ProcessHandshake () [0x00000] in <00000000000000000000000000000000>:0
    at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncOperationStatus status) [0x00000] in <00000000000000000000000000000000>:0
    at Mono.Net.Security.SystemCertificateValidator..cctor () [0x00000] in <00000000000000000000000000000000>:0
    at System.Threading.TimerCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
    at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state,

    Note I have sharedUserCertificates capability checked on. (It also fails if I check it off).
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    My guess is this is what happens when your server is using a self signed certificate which the client doesn't know is safe to use.
     
    MrsPiggy likes this.
  3. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    yeah the first question to ask is: is it a valid certificate? Meaning one signed by a certification authority? If not that's the problem.
     
    Joe-Censored likes this.
  4. DerrickLau

    DerrickLau

    Joined:
    Sep 29, 2013
    Posts:
    70
    I put in a SSL certificate signed by a certification authority (SSLS.com) and while I can talk to my service using the UWP app from my laptop, it still throws the same error from XBox One.
     
  5. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    154
    Maybe you should talk to MS support and ask them? I think there could be platform specific restrictions that go beyond the SSL certificate