microsoft / MixedReality-HolographicRemoting-Samples

Code samples for using Microsoft's Holographic Remoting library.
Other
141 stars 47 forks source link

Holographic remoting desktop app connection failed with error HandshakeConnectionFailed (5) #75

Closed if-mindesk closed 8 months ago

if-mindesk commented 1 year ago

Hi, we are developing a native windows desktop app using the nuget package Microsoft.Holographic.Remoting 2.8.1 Everything works fine on some pcs but on some others we get the connection error 5 (HandshakeConnectionFailed) We suspect that the problem could be caused by the PerceptionDevice.dll. We redist the PerceptionDevice dll with our app but we also found a copy of this dll inside the system32 folder. There is a note about Version 2.3.1 (October 10, 2020) Implemented PerceptionDeviceSetCreateFactoryOverride, which ensures that PerceptionDevice.dll shipped with Holographic Remoting doesn't interfere with the version shipped with Windows 10, but there isn't any documentation about that

Ivan

markkeinz commented 1 year ago

Hi Ivan,

The error code you are seeing hints to a problem that happens after the initial handshake connection between the two peers has been opened, but before the actual handshake is performed. The most likely causes for this are a mismatch of secure/insecure connection modes between the peers, or a failing server certificate validation by the client (in case of secure connection).

I'm not ruling out PerceptionDevice completely, but if there is a problem relating to it, I would expect a failure at a different point in the connection flow.

Are you using a secure connection? If so, I'd suggest making sure the server certificate is actually valid and trusted, and that the certificate validation on the Holographic Remoting client validates it correctly.

I'm happy to provide more detailed instructions if needed, just let me know. :)

- Mark

if-mindesk commented 1 year ago

Hi Mark, I am not using a secure connection. I am using the standard player downloaded from the MS store. I was thinking about the PerceptionDevice dll because one of our tester said that after deleting the version distributed with our app it worked for a few time and then stopped working again. It would be useful to have more details about the perceptiondevice dll. On my machine I can see that our app loads two version of the dll. One from the app folder and one from the system32 folder. If I remove one of the two dlls the app still works.

Ivan

markkeinz commented 1 year ago

Hi Ivan,

On non-secure connections, the handshake is performed using HTTP over a plain TCP connection. I did some investigation on my side, and the error you're getting will only be generated if the HTTP exchange doesn't complete after the TCP connection has been established (e.g., by the connection being closed prematurely) or if the peer returns an unexpected HTTP status code.

If I understand correctly, in your scenario the Remoting Player is running on a Hololens device and listening for connections, while your native app is running on a PC and trying to connect to the player on the Hololens, correct?

Is there any network security software running on the PC which might intercept and possibly alter HTTP traffic (or, if you're in a corporate network, any security appliance doing the same)? And if so, does it fix the issue if you temporarily deactivate it or add an exception?

Let's first check this, and hope that it will yield some clues. :)

- Mark

if-mindesk commented 1 year ago

Hi Mark, Yes in our scenario the Remoting Player is running on a Hololens device and listening for connections, while our native app is running on a PC and trying to connect to the player on the Hololens. There isn't any network security software running on the PC. We also disabled Windows Defender Firewall.

Ivan

markkeinz commented 1 year ago

Hi Ivan,

with secure connection and firewall having been ruled out as possible causes, I fear we'll have to dig deeper to understand what exactly is happening in your case.

One way to do this would be to trace the network traffic between the PC and the Hololens using Wireshark or a similar program.

The regular connection flow should be as follows:

To shed more light on the problem, we would need to know how far this connection flow gets for you before it errors out. As I mentioned before, the connection result you're getting hints to something happening after the TCP connection has been established, but before the HTTP response has been properly received.

If you're not familiar with Wireshark, let me know so I can write up some quick instructions.

Thanks, - Mark

chairobl commented 8 months ago

Hi @if-mindesk, since this issue has been inactive for some time now I'll be closing it. If you're still encountering issues feel free to reopen it :)