Search Unity

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

Discussion in 'Connected Games' started by DerrickLau, Sep 9, 2019.

  1. DerrickLau

    DerrickLau

    Joined:
    Sep 29, 2013
    Posts:
    67
    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:
    6,324
    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:
    93
    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:
    67
    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:
    93
    Maybe you should talk to MS support and ask them? I think there could be platform specific restrictions that go beyond the SSL certificate