Skip to content

Unity 6000.0.45f1 seems broken ( upgrading from Unity 2022 ) - Mono.Security.Interface.TlsException: Failed to create UnityTls context - error code: UNITYTLS_INVALID_ARGUMENTΒ #62

@dziemid

Description

@dziemid

Hello,

After upgrading from Unity 2022 to latest Unity 6, I am getting:

Pusher Errored with PusherClient.WebsocketException: WebSocket error emitted:
Failed to create UnityTls context - error code: UNITYTLS_INVALID_ARGUMENT ---> Mono.Security.Interface.TlsException: Failed to create UnityTls context - error code: UNITYTLS_INVALID_ARGUMENT
  at Mono.Unity.Debug.CheckAndThrow (Mono.Unity.UnityTls+unitytls_errorstate errorState, System.String context, Mono.Security.Interface.AlertDescription defaultAlert) [0x00027] in <ce414afeeb0f4550b5da58efd5c2db86>:0 
  at Mono.Unity.UnityTlsContext..ctor (Mono.Net.Security.MobileAuthenticatedStream parent, Mono.Net.Security.MonoSslAuthenticationOptions options) [0x002af] in <ce414afeeb0f4550b5da58efd5c2db86>:0 
  at Mono.Unity.UnityTlsStream.CreateContext (Mono.Net.Security.MonoSslAuthenticationOptions options) [0x00000] in <ce414afeeb0f4550b5da58efd5c2db86>:0 
  at Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Boolean runSynchronously, Mono.Net.Security.MonoSslAuthenticationOptions options, System.Threading.CancellationToken cancellationToken) [0x0014c] in <ce414afeeb0f4550b5da58efd5c2db86>:0 
  at System.Threading.Tasks.TaskToApm.End (System.IAsyncResult asyncResult) [0x0002a] in <314938d17f3848e8ac683e11b27f62ee>:0 
  at System.Net.Security.SslStream.EndAuthenticateAsClient (System.IAsyncResult asyncResult) [0x00000] in <ce414afeeb0f4550b5da58efd5c2db86>:0 
  at SuperSocket.ClientEngine.SslStreamTcpSession.OnAuthenticated (System.IAsyncResult result) [0x00028] in <d48c73b87c95425b91162817ccffec2d>:0 
   --- End of inner exception stack trace ---
  at PusherClient.Connection.ConnectAsync () [0x001b9] in <ccf2fc67a8904475a9971ddfbe5aa388>:0 
  at PusherClient.Pusher.ConnectAsync () [0x001b0] in <ccf2fc67a8904475a9971ddfbe5aa388>:0 

I've tried both 2.1.0+211120 and 2.3.0-beta+230104.

  _pusher = new Pusher(APP_KEY, new PusherOptions()
            {
                Cluster = APP_CLUSTER,
                Encrypted = true,
            });

Changing Encrypted to false makes the client connect successfully.

Not sure if a newer version of WebSocket4Net would work?
https://www.nuget.org/packages/WebSocket4Net/#versions-body-tab

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions