Open metalogica opened 1 year ago
I used a debugger to figure out some more context, which I detail below.
// WebSocket.cs
// we crash here
await m_Socket.ConnectAsync(uri, m_CancellationToken); l.472
UNITYTLS_INTERNAL_ERROR
at System.Net.WebSockets.WebSocketHandle.ConnectAsyncCore (System.Uri uri, System.Threading.CancellationToken cancellationToken, System.Net.WebSockets.ClientWebSocketOptions options) [0x00391] in <2fe115660d9c47728edff248f3625297>:0 \n at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore (System.Uri uri, System.Threading.CancellationToken cancellationToken) [0x000d1] in <2fe115660d9c47728edff248f3625297>:0
at NativeWebSocket.WebSocket.Connect () [0x001a5] in /Users/richardjarram/Documents/unity/unity-bp-physics-master/Library/PackageCache/com.endel.nativewebsocket@c5101c0776/WebSocket/WebSocket.cs:472
Does it work if you try with ws
instead of wss
? ws://192.168.0.xxx:6868
wss
means secure and it will expect a TLS certificate configured
unfortunately the web socket server I am accessing is a propriety application running on my local raspberry pi. just for info, its the emotiv cortex brain machine interface api.
It only uses wss://
and there is no config for ws://
.
Do you think it could be related to certificate parsing in the websocket library?
In Unity, when I run wss://127.0.0.1:6868
I get the same connection error as before.
I have a self-signed cert for localhost
but not for 127.0.0.1
.
Perhaps I need to create self signed cert for the ip 192.168.0.42
(or create a hostname for it, then a cert for that) in order to get this thing running?
I created a self signed cert on my local machine for this service but to no avail.
Seems top be similar to these issues: https://github.com/endel/NativeWebSocket/issues/1 https://github.com/endel/NativeWebSocket/issues/70
PROBLEM
Im trying to connect to a websocket server hosted on my lan at
wss://192.168.0.42:6868
. It doesn't require authorization.The websocket client fails the TLS handshake if i use an external ip like
wss://192.168.0.xxx:6868
but it works fine if i usewss://localhost:6868
DETAILS
I can connect via the the TUI app wscat, but when I try to connect via the Unity editor I get the following error:
Ideally I'd like to connect to the same local web socketserver over the local network on the Unity editor, and via a compiled device in VR.